I'm writing a websocket server using multiple threads, so at anytime two threads could be sending a message to the same socket/websocketsession, but can't figure out whether I should use a lock around Send method OR are these methods thread safe?
Also, these methods don't have any return value, so what happens if the socket is closed by remote side while sending data or Send is called After a socket is closed but reference is still valid? would it throw an exception?