in reply to IO::Socket::INET in worker threads

Without seeing your code, if you keep the threads in a recv() loop, you are effectively locking them into just receiving. 2-way sockets need to be handled in a bi-directional manner, see Simple threaded chat server for some ideas. Else, you can use a shared variable to your threads, which they can use to switch them to the send() mode.

Or you could spawn 2 threads, one for sending or for receiving. This is what is commonly done in socket clients, they are forked( or threaded) to make them receive/send at the same time....i.e. bidirectional. See Simple bi-directional forking commandline client

Without the bidirectional forking/threading/select code in your socket code, you will need to setup a protocol to tell both ends of the connection which mode to be in send() or recv(), and constantly juggle them.


I'm not really a human, but I play one on earth My Petition to the Great Cosmic Conciousness