|
|
@ -709,10 +709,19 @@ func (c *Client) RecvDetail() (m derp.ReceivedMessage, connGen int, err error) {
|
|
|
|
m, err = client.Recv()
|
|
|
|
m, err = client.Recv()
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
c.closeForReconnect(client)
|
|
|
|
c.closeForReconnect(client)
|
|
|
|
|
|
|
|
if c.isClosed() {
|
|
|
|
|
|
|
|
err = ErrClientClosed
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return m, connGen, err
|
|
|
|
return m, connGen, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (c *Client) isClosed() bool {
|
|
|
|
|
|
|
|
c.mu.Lock()
|
|
|
|
|
|
|
|
defer c.mu.Unlock()
|
|
|
|
|
|
|
|
return c.closed
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Close closes the client. It will not automatically reconnect after
|
|
|
|
// Close closes the client. It will not automatically reconnect after
|
|
|
|
// being closed.
|
|
|
|
// being closed.
|
|
|
|
func (c *Client) Close() error {
|
|
|
|
func (c *Client) Close() error {
|
|
|
|