Hi All,
For quite some time now, I've been trying to implement a multi-threaded or forked TCP server to perform the following action:
1) Listen for new connections on all ip addresses on a specific port.
2) Wait for a new connection to arrive
3) When a new connection comes in, fork or thread to free up the listening process so it can go back to #2.
When handling a client after it's been forked/threaded
4) Get the connected client's ip address.
5) Perform some in-house processing;
6) Read the data sent from the client (checking for http connections)
7) Perform some more processing;
8) Write some data back to the client based on the above processing
9) Close the socket/thread/fork
I've tried implementing an solution similar to the multi-threaded example show here
http://perl.active-venture.com/pod/p...-sockets.html; as well as looking at the CPAN solutions Net:
aemon and POE::Component::Server::TCP but these don't seem to give me the information needed.
The active-venture solution provides me with what I need, but randomly exits without reason/error and when attempting to change the 'for' loop to a 'while' loop, it keeps throwing up different errors.
Thanks in advance for any help.
Anubis.