diff --git a/ws/client.go b/ws/client.go index 308b7dd..38fd34c 100644 --- a/ws/client.go +++ b/ws/client.go @@ -257,15 +257,16 @@ func (c *client) close(status MessageError, clientACK bool){ return } - /* (2) kill reader if still running */ - c.io.sock.SetReadDeadline(time.Now().Add(time.Second*-1)) - c.io.reading.Wait() - - /* (3) kill writer' if still running */ + /* (2) kill writer' if still running */ if c.io.writing { close(c.ch.send) } + /* (3) kill reader if still running */ + c.io.sock.SetReadDeadline(time.Now().Add(time.Second*-1)) + c.io.reading.Wait() + + if status == NONE { status = NORMAL