By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,881 Members | 1,459 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,881 IT Pros & Developers. It's quick & easy.

sockets - how to listen on multiple ports

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <0f********************@comcast.com>, Jim Kipp
<jk****@comcast.net> wrote:
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.
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.