sockets - how to listen on multiple ports

J

Jim Kipp

Hi
I am writing a simple server to monitor ports. The problem is I don't know
how to make it listen on multiple ports. It creates the first socket,
listens, than accepts and of course the accept call blocks, so it does not
return to create socket for the other ports. I am doing this in windows, so
using 'fcntl' to do non blocking won't work.
Any suggestions? I can paste the code if need be.

Thanks
 
J

Jim Gibson

Jim Kipp said:
Hi
I am writing a simple server to monitor ports. The problem is I don't know
how to make it listen on multiple ports. It creates the first socket,
listens, than accepts and of course the accept call blocks, so it does not
return to create socket for the other ports. I am doing this in windows, so
using 'fcntl' to do non blocking won't work.
Any suggestions? I can paste the code if need be.

Thanks

Under Unix, you would use the select function, or the OO
interface-to-select IO::Select. Hopefully, these work under windows. In
particular, see "perldoc IO::Select" for an example of how to monitor
input from several sockets.

FYI: this newsgroup is defunct. Try comp.lang.perl.misc in the future.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top