TODO: close() may block if the remote endpoint doesn't read the data
(eventually there will be a TimeoutException). However, this method
(sendMessage) is intended to run asynchronous code and shouldn't
block. Otherwise it would temporarily stop processing of messages
from other clients.
Maybe call this method on another thread.
Note that when this method is called, the RemoteEndpoint.Async
is still in the process of sending data, so there probably should
be another way to abort the Websocket connection.
Ideally, there should be some abort() method that cancels the
connection immediately...