473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

sockets - how to listen on multiple ports

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
1 4806
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Dmitry Akselrod | last post by:
Sockets Programming Question: I have two applications. One is a server, one is a client. However, both listen on certain ports for communication. The server is written in vb.net...
4
by: 0to60 | last post by:
I have a question about socket programming in general. Exactly what happens behind the scenes when I one socket connects to a different socket in listen mode? Using the dotnet framework, I...
7
by: Steven | last post by:
Hi, Thanks all for you help with my "socket and buffer size" question. I have decided to use async ones, and my code is working pretty well. But i still have a non-answered question: Is it...
0
by: Valleriani | last post by:
Right Now I've been working on a text based game for fun. It was working fine but they I relized that you need to shut/close the ports. Before I was just opening ports and not shutting them, no...
2
by: jasonsgeiger | last post by:
From: "Factor" <jasonsgeiger@gmail.com> Newsgroups: microsoft.public.in.csharp Subject: Multiple Clients, One port Date: Wed, 19 Apr 2006 09:36:02 -0700 I'm been working with sockets for a...
1
by: verge | last post by:
hello everyone! how's it going? like everyone in here im in need of some help and good friendship along the way...take a look at this: //MODIFIED SO IT DEALS WITH WINDOWS FTP USING ACTIVE...
5
by: Mark | last post by:
I am working on a Windows service application that will listen on multiple IPs and ports e.g. port 25, 110 etc. As far as I could see the EndPoint only contains one IP and a port. How is it possible...
2
by: Abubakar | last post by:
Hi, I'm working on a sockets app (using all those connect, socket, recv, send stuff). There is one problem on just one of many pcs i deal with. This pc, sometimes my app crashes on it, which is...
1
by: jcprince | last post by:
Hi Not sure I can do what I'm trying to do without using a 3rd party component like Dart. I need to build a windows service to create a socket connection on an IBM mainframe using an IP and port...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.