If you want to keep waiting on data from the client, you need to keep reading from the client. See for example "TCP Servers with IO::Socket" in perlipc.
However, I would strongly recommend against writing a server at such a low level. Nowadays, I think that event loops are the way to go. I've used POE, but that has a fairly high learning curve, and so I can recommend Mojo::IOLoop. Yes Mojolicious is a web framework, but the aforementioned module can be used independently of the framework to write TCP servers IMHO very easily. Example code here.
In reply to Re: IO::Socket simple server
by haukex
in thread IO::Socket simple server
by packetstormer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |