Let me recommend a third alternative to fork or threads. Use IO::Select to manage reading from the sockets whenever data is available.
I guess that handling a disconnected socket is also possible if you detect that you get a timeout while waiting for data.
In reply to Re: Two TCP Connections, one script
by Corion
in thread Two TCP Connections, one script
by deadpickle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |