Your skill will accomplish
what the force of many cannot
New to perl: IO Select question :(by CompleteMoron (Initiate)
|on Aug 20, 2005 at 23:50 UTC
CompleteMoron has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I'm new to perl (allthough Im pretty good with php and delphi) and have been making some small programs. I just started a program and allready am stuck. I am trying to make a server/client app. All that th server does is accept connections, and on reading data from a client, sends it to every other one. The client should connect to the server, receive data from it, and send data to it, a very very simple chat application in short. I am having problems with the server, to manage the different connections, I am using the select() function, as described here: http://www.perlfect.com/articles/select.shtml My code allmost exactly the same as that, and it still deosnt work, for a start I would like it to print the data received from the clien on the screen, what is wrong here (it never prints the data to the screen)?:
I have allready anticipated another problem I will have. As you see, it accepts any new sockets, but what if, I want to send data to all open sockets the server has received? I see no where (array, etc) where the sockets are saved. Any help?