home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.protocols.tcp-ip      TCP and IP network protocols.      14,669 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 14,289 of 14,669   
   herrmannsfeldt@gmail.com to robert...@yahoo.com   
   Re: binding to ephemeral ports?   
   14 Apr 17 00:16:01   
   
   On Thursday, April 13, 2017 at 5:24:34 PM UTC-7, robert...@yahoo.com wrote:   
      
   (snip, I wrote)   
   > >What is supposed to happen if a server wants to bind() to a port   
   > >which happens to already be in use by a TCP session?   
      
   > >Since the TCP session is identified by the quad source address,   
   > >source port, destination address, destination port, that should not   
   > >limit the ability to bind() to that port.  But is that what   
   > >really happens on real systems?   
      
   > On most systems, you will only be able to successfully bind to a port   
   > not otherwise being used.  There may be ways to override a bit   
   > (SO_REUSEADDRESS/PORT), but those often don't do what you want.   
      
   Interesting.  I was suspecting that it wouldn't cause a conflict,   
   but didn't know.  It turns out that the question came from someone   
   misunderstanding how their program worked.   
      
   > In general ephemeral ports should be coming out of a different range   
   > than statically allocated ports, and so should not conflict, OTOH,   
   > OS's have not been consistent which ranges get assigned to what - old   
   > Windows, for example, used to use 1025-5000 for ephemeral port, but   
   > now uses 49152+, as do most *nix).   
      
   Presumably that works unless one host wants many thousands of connections   
   to one port on a server. Rare, but not impossible.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca