rpc : fix quit channel goroutine leak

This commit is contained in:
ucwong 2020-04-03 08:52:47 +00:00
parent f7b29ec942
commit 6c678a5cc0
2 changed files with 4 additions and 4 deletions

View file

@ -209,9 +209,9 @@ func initClient(conn ServerCodec, idgen func() ID, services *serviceRegistry) *C
isHTTP: isHTTP,
services: services,
writeConn: conn,
close: make(chan struct{}),
closing: make(chan struct{}),
didClose: make(chan struct{}),
close: make(chan struct{}, 1),
closing: make(chan struct{}, 1),
didClose: make(chan struct{}, 1),
reconnected: make(chan ServerCodec),
readOp: make(chan readOp),
readErr: make(chan error),

View file

@ -219,7 +219,7 @@ func newClientSubscription(c *Client, namespace string, channel reflect.Value) *
namespace: namespace,
etype: channel.Type().Elem(),
channel: channel,
quit: make(chan struct{}),
quit: make(chan struct{}, 1),
err: make(chan error, 1),
in: make(chan json.RawMessage),
}