fix bug when ws.Receive failed do not use the socket for writing.