couple bug fixes in tunnel
This commit is contained in:
parent
972c0989af
commit
2c0801fc1c
@ -1060,6 +1060,8 @@ func (n *network) Connect() error {
|
|||||||
|
|
||||||
// send the connect message
|
// send the connect message
|
||||||
n.sendConnect()
|
n.sendConnect()
|
||||||
|
// most importantly
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -354,14 +354,14 @@ func (s *session) Send(m *transport.Message) error {
|
|||||||
|
|
||||||
// Recv is used to receive a message
|
// Recv is used to receive a message
|
||||||
func (s *session) Recv(m *transport.Message) error {
|
func (s *session) Recv(m *transport.Message) error {
|
||||||
|
var msg *message
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-s.closed:
|
case <-s.closed:
|
||||||
return errors.New("session is closed")
|
return errors.New("session is closed")
|
||||||
default:
|
|
||||||
// no op
|
|
||||||
}
|
|
||||||
// recv from backlog
|
// recv from backlog
|
||||||
msg := <-s.recv
|
case msg = <-s.recv:
|
||||||
|
}
|
||||||
|
|
||||||
// check the error if one exists
|
// check the error if one exists
|
||||||
select {
|
select {
|
||||||
|
Loading…
Reference in New Issue
Block a user