On Sat, Apr 10, 2010 at 3:48 PM, Kim Gräsman <[email protected]> wrote:
> Hello,
>
> On Sat, Apr 10, 2010 at 07:20, Dean Michael Berris
> <[email protected]> wrote:
>>
>> If the system is POSIX compliant, this should not be an issue because
>> SO_REUSEADDR applies to whether the listening application can re-use
>> the socket in the TIME_WAIT state (that which has been closed
>> already). This is important for efficiency reasons, although can
>> definitely be dangerous in systems where the networking stack doesn't
>> clean up properly.
>>
>> If this is a problem only in Windows then we should have a special
>> compiler flag that turns it off.
>>
>> http://www.unixguide.net/network/socketfaq/4.5.shtml
>
> I'm not even sure it's a problem, really. It's just a bit confusing,
> but I'm not sure I see a breaking scenario if listening to the same
> port twice _doesn't_ throw, which seems to be scenario here. Thoughts?
>

If the problem is really that in Windows, then it might be a bug in Asio.

The thing is, in Linux at least, the expectation when you try to
listen/bind to an address/port pair that is already bound to by some
other process, the second attempt should fail. I am not sure if this
is the same in Windows, and if removing the SO_REUSEADDR is the
solution for that platform to keep the expectations consistent on both
Linux and Windows, then it might be worth addressing.

HTH

-- 
Dean Michael Berris
deanberris.com

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cpp-netlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel

Reply via email to