Be sure to be prepared that someone deletes the socket behind your back. Also bear in mind that if an object lives in thread B, you can't write to it (or read from it) from thread A. Hence if you have some kind of WsServer object, it can't access a WsSocket object directly if the latter lives in a different thread (which implies you have to implement all functionality of the active connection in the socket class and not in the server class).
Bookmarks