Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: (5) : UDP and IO::Socketby agoth (Chaplain) |
on Jan 16, 2002 at 15:35 UTC ( [id://139176]=note: print w/replies, xml ) | Need Help?? |
As I understand it, (i.e. I'm not positive), calling IO::Select on a list of handles returns a list of waiting filehandles ( in this case sockets ), and in your case as you are not writing out, the only waiting handles will be readable handles, zero one or many.
In the loop, you can then iterate over any readable handles that have been assigned to @read by calling IO::Select, doing with as you wish. As you're using UDP, you don't need to worry about the connection unduly, nor have to close or give a response as the client doesn't wait for anything so you can just discard the client request as you don't want to sleep. In the code below, the udp socket is added to the list of known waiting input readers, HTH, I only posted briefly yesterday 'cos I was in a rush, but hope this is clearer..
In Section
Seekers of Perl Wisdom
|
|