-----Original Message-----
From: Bob McConnell [mailto:[EMAIL PROTECTED] 

> Which I forgot to mention is that both my sockets are connected to
> different ports... (54321 & 1024)
> And also, one socket is connected to a server, and the other socket is
> accepting from a client.... 
> Does this change anything??
> 
> So Loop 1 is reading stuff that is happening on the server.
> And Loop 2 is reading stuff that a direct client is sending.
> 
> Marco!


>>At this level, the only difference between a client and a server is
the
>>opening sequence. After the sockets are open, they can be treated
>>exactly the same.

>>So once you have the sockets open, and as long as there are no pending
>>listens for additional connections, there are no differences in how
you
>>read or write on multiple sockets. You need a single loop where select
>>will return when one or both sockets have received data, when it times
>>out or when a signal is received, whichever comes first. The timeout
can
>>be used to check for other events, like keyboard input, before you
loop
>>back into the select call.

>>Bob McConnell


Thanks Bob, that makes things a bit more clear.
So say that I have <$socket1> and <$socket2>....
How can I read from both using one loop then??

Marco!




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to