A socket is not an object - it is just a number (or, presumably, a pointer). If you pass an integer from one stream to another, then there is no problem - the same with sockets. This assumes that you are asking about OS-level sockets, not some class of sockets that you or the framework you use have implemented, and that you only get access to the socket from one of the threads, which looks like this.
anon
source
share