<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Windows reuseaddr is dysfunctional and will reuse an address that is
not in time_wait, i.e. it can steal sockets from other programs.
There is a plethora of windows specific options to use instead, of
which none emulates the correct behaviour without also expecting
other programs to have used windows specific options, which they
usually don't. I looked into it again some months ago, hoping that
this was ancient history, but unfortunately Windows 7 still has this
unexpected behaviour.<br>
<br>
The only sensible thing, which allows for the best portability of
code over platforms, is to ignore the option on Windows.<br>
<br>
Cheers,<br>
/Patrik<br>
On 10/14/2012 05:54 AM, hume npx wrote:
<blockquote
cite="mid:CAKpwNc8vNUZtPB8K-6eA=5mxFLoeuRsMMXO3hXrrq=A0nEOhVg@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
using reuseaddr option while do UDP socket processing, it is not
functional. I searched the question on google, it seems that it's
caused by inet_drv.c line 5611, in fact win32 support reuseaddr,
should the following
<div>
<br>
</div>
<div>
<div>#ifdef __WIN32__</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>
continue; /* Bjorn says */</div>
<div>#else</div>
<div><br>
</div>
<div>part be commented?</div>
<div><br>
</div>
<div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>case
INET_OPT_REUSEADDR: </div>
<div>#ifdef __WIN32__</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>
continue; /* Bjorn says */</div>
<div>#else</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>
type = SO_REUSEADDR;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>
DEBUGF(("inet_set_opts(%ld): s=%d, SO_REUSEADDR=%d\r\n",</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>
(long)desc->port, desc->s,ival));</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>
break;</div>
<div>#endif</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-bugs mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-bugs">http://erlang.org/mailman/listinfo/erlang-bugs</a>
</pre>
</blockquote>
<br>
</body>
</html>