|
-
April 15th, 2010, 04:23 AM
#5
Re: How can multiple servers be listening to the same HTTP port 80?
The use of SO_REUSEADDR is only valid for servers when they startup. It makes sure a server can use the well-known port after e. g. a crash. Otherwise, the socket might be in state TIME_WAIT and the server would be unable to restart.
Using SO_REUSEADDR in other cases, i. e. for "sharing" a port between 2 servers, will lead to undefined behaviour. The socket is kind of "stolen" from the first server when the scond server sets this option.
I have made some experiments on a Windows XP some years ago, and the result was unpredictable. I strongly discourage the use for other purposes than the one mentioned above.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|