I think this is a problem with WebSocketSharp. If you read their docs, it says this:
The WebSocket class inherits the System.IDisposable interface, so you can use the using statement. And the WebSocket connection will be closed with close status 1001 (going away) when the control leaves the using block.
Control must be leaving your using block and causing that 1001 status.