Re: socket.unbind or socket.unlisten? - socket.error: (48,'Addressalready in use')

Discussion in 'Python' started by Hendrik van Rooyen, Feb 2, 2009.

  1. "Steve Holden" <> wrote:

    >
    > My previous reply assumed you are running some UNIX-like operating
    > system. If you are on Windows then Jean-Paul's advice stands, as Windows
    > *does* allow several processes to listen on the same port and randomly
    > delivers incoming connections to one of the listening processes.
    >
    > I believe this is because Microsoft failed to understand the original
    > meaning of SO_REUSEADDR for their early TCP implementations, and
    > persisted with this ghastly error in the name of backwards
    > compatibility, justifying it by suggesting that listener pools could be
    > created. Or some such nonsense. Perhaps someone with more insight into
    > the development process could comment. It seems to me it's completely
    > bizarre.
    >
    > However, under Windows 2000 and later you should find there's an
    > SO_EXCLUSIVEADDRUSE flag which you can use to ensure a single listener -
    > see http://msdn.microsoft.com/en-us/library/ms740621(VS.85).aspx. No
    > need for separate locks.
    >


    Thanks Steve - I am not the OP, I was just curious as to why
    Jean-Paul was saying what he did - so the only reason I have
    not been bitten on windoze yet must be either because I am
    lucky, or because my server side stuff is linux and there is the
    occasional windows client. So I don't really listen on windows.

    "a pool of listeners" - just think of the fun one can have trying to
    keep state between them - would be a marvellous job if someone
    else is paying top dollar by the hour - I can just see the team growing
    as the need for new specialists are discovered as one goes along.

    :)

    - Hendrik
     
    Hendrik van Rooyen, Feb 2, 2009
    #1
    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. Laszlo Nagy
    Replies:
    1
    Views:
    4,924
    Mark Wooding
    Jan 27, 2009
  2. Jean-Paul Calderone
    Replies:
    0
    Views:
    992
    Jean-Paul Calderone
    Jan 27, 2009
  3. Laszlo Nagy
    Replies:
    0
    Views:
    566
    Laszlo Nagy
    Feb 1, 2009
  4. Steve Holden
    Replies:
    0
    Views:
    684
    Steve Holden
    Feb 1, 2009
  5. Steve Holden
    Replies:
    1
    Views:
    730
Loading...

Share This Page