in reply to IO::Socket/multiple connections related
There are many solutions. The simplest is certainly a forking server. After accept()ing a new client the process calls fork(). The parent process closes the client connection and waits for the next client while the child handles the connection.
Another way is to use select() (or IO::Select) with nonblocking IO. There are many examples on the Internet I believe.
Then there are various event modules that do basically the same as select() but often more effectively. These come to mind: Event, Event::Lib, EV, POE, AnyEvent
Then there are perl's ithreads. (use threads;)
And in the end there is Coro. If I where you I'd go either with this one or code a forking server.
Torsten
|
|---|