I'm trying to write a client and server using sockets (using ActivePerl under Win32).
I need to allow multiple clients to connect to a server. I need to have the server send info to the clients (server writes and client reads) *BUT* I also need to allow the clients to write to the server (client writes and server reads). The "writes" will be non-interactive--I need to stay away from STDIN! Most of the code I've seen has an infinite loop for reading from the client, but that won't work here. I'm guessing that an OO design would work the best, as in:
sub onClientConnect { }
sub onClientRead { }
sub onClientWrite { }
sub onClientDisconnect { }
but this may be too difficult to do.
Does anyone have any ideas...or better yet, code examples?
Thanks!
Jeremy