Possible Duplicate:
Are parallel calls to send/recv on the same socket valid?
I’m going to use one thread to receive data from socket(read) and another one to send data throughout socket(write).
Is it good idea to use one socket in two different threads?
There should be no problems sharing a socket across threads. If there is any kind of coordination required between the reading and the writing, and there probably will be, you’re going to need to synchronize that in some way.
This article, File Descriptors And Multithreaded Programs, may be helpful and addresses the comment below.
From the socket manpage
You should be able to read and write both directions no problem, the directions are just about unrelated once the connection has been set up, at least in TCP.