File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
internal/transporter/internal/client Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ func NewClient(opts *Options) *Client {
3737 c .opts = opts
3838 c .connections = make ([]* Conn , 0 , defaultConnNum )
3939 c .disorderlyQueue = make (chan * chWrite , 10240 )
40+ c .closed .Store (true )
4041 c .pool = sync.Pool {New : func () any { return & chWrite {} }}
4142
4243 return c
@@ -74,6 +75,8 @@ func (c *Client) Establish() error {
7475 return err
7576 }
7677
78+ c .closed .Store (false )
79+
7780 return nil
7881}
7982
Original file line number Diff line number Diff line change @@ -127,10 +127,11 @@ func (c *Conn) handshake(conn net.Conn) error {
127127
128128 c .pending .store (seq , call )
129129
130- defer close (call )
131-
132130 if _ , err := conn .Write (buf .Bytes ()); err != nil {
131+ close (call )
132+
133133 c .pending .delete (seq )
134+
134135 return err
135136 }
136137
You can’t perform that action at this time.
0 commit comments