very simple perl chat server
i'm new to Perl , i am trying to write a very simple chat server,which will take each client's message and send it back to all other clients,but i'm unable to send the message to other clients,anyway this is my code.any help would be appreciated
Code:
use strict; |
Code:
while(1) { |
thank you,
for instance,if 5 connection accept then we'll have 5 $clnt ? how can i have a single process without using select() just with fork(). can we have all the client(s) in an array? like! Quote:
is that even right? thanks in advance |
you can keep your clients in an array, that would be ok. But I think you will need to use select otherwise it will be really difficult to implement (or probably impossible)
|
thank you
|
this is a sample for you: http://poe.perl.org/?POE_Cookbook/Chat_Server
select is here hidden inside the POE package. You can find several tutorials about it: http://www.nntp.perl.org/group/perl....msg113832.html or ... |
All times are GMT -5. The time now is 04:29 PM. |