sockets - how to listen on multiple ports

Discussion in 'Perl' started by Jim Kipp, Feb 8, 2004.

  1. Jim Kipp

    Jim Kipp Guest

    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
     
    Jim Kipp, Feb 8, 2004
    #1
    1. Advertising

  2. Jim Kipp

    Jim Gibson Guest

    In article <>, Jim Kipp
    <> 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.
     
    Jim Gibson, Feb 12, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Kuhn
    Replies:
    4
    Views:
    921
    Thomas Kuhn
    Jul 7, 2003
  2. Ryan Stewart
    Replies:
    1
    Views:
    828
    Tor Iver Wilhelmsen
    Jan 17, 2004
  3. Donny
    Replies:
    13
    Views:
    672
    Donny
    Aug 5, 2004
  4. mreister
    Replies:
    1
    Views:
    3,182
    mreister
    May 25, 2010
  5. Ersek, Laszlo

    Re: Listen to multiple ports

    Ersek, Laszlo, Jun 24, 2010, in forum: C Programming
    Replies:
    2
    Views:
    2,160
    Jorgen Grahn
    Jun 25, 2010
Loading...

Share This Page