in reply to request, IO::Socket Select() & Fork() example
The performance of fork is system-dependent. Linux provides a very inexpensive fork, the task generation and switch being faster than threads due to Copy On Write for the environment and other optimizations. Windows perl emulates fork with win32 native threads which I believe to be rather expensive.
IO::Select is a wrapper for perl's 4-arg select. It is, in effect, a sleep-until-I/O-ready operation.
You don't say what examples you have tried, but "They don't print any of the data that I send to them" sounds like you have problems with either buffering or making the connection from a client. Or maybe just the printing. You need to show code to get a diagnosis from us.
It's de rigeur to recommend POE at this point, but I'm not going to do that yet. It's worthwhile to learn to use bare metal sockets and fork.
After Compline,
Zaxo
|
|---|