-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: dead lock during reopen conn of broker
- Loading branch information
Showing
5 changed files
with
133 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package healer | ||
|
||
import ( | ||
"net" | ||
"time" | ||
) | ||
|
||
// MockConn is a mock struct for the Conn type | ||
type MockConn struct { | ||
MockRead func(p []byte) (n int, err error) | ||
MockWrite func(p []byte) (n int, err error) | ||
MockClose func() error | ||
MockLocalAddr func() net.Addr | ||
MockRemoteAddr func() net.Addr | ||
MockSetDeadline func(t time.Time) error | ||
MockSetReadDeadline func(t time.Time) error | ||
MockSetWriteDeadline func(t time.Time) error | ||
} | ||
|
||
func (_m *MockConn) Read(p []byte) (n int, err error) { | ||
return len(p), nil | ||
} | ||
|
||
func (_m *MockConn) Write(p []byte) (n int, err error) { | ||
return len(p), nil | ||
} | ||
|
||
func (_m *MockConn) Close() error { | ||
return nil | ||
} | ||
|
||
func (_m *MockConn) LocalAddr() net.Addr { | ||
return nil | ||
} | ||
|
||
func (_m *MockConn) RemoteAddr() net.Addr { | ||
return nil | ||
} | ||
|
||
func (_m *MockConn) SetDeadline(t time.Time) error { | ||
return nil | ||
} | ||
|
||
func (_m *MockConn) SetReadDeadline(t time.Time) error { | ||
return nil | ||
} | ||
|
||
func (_m *MockConn) SetWriteDeadline(t time.Time) error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters