<div dir="ltr"><div>Why can this sometimes exit with exception error: no match of right hand side value {error,eaddrinuse} ?</div><div><br></div><div>As far as I know, nothing's connecting to the socket in this time.</div>
<div><br></div>[ begin {ok, LSock} = gen_tcp:listen(12345, [{reuseaddr, true}]),<div> {error, timeout} = gen_tcp:accept(LSock, 0),</div><div> ok = gen_tcp:close(LSock)</div><div> end </div><div> || _X <- lists:seq(1, 100000) ].<br>
</div><div><br></div><div>This is on R14 and 15 on linux and R16 on OS X.</div><div><br></div><div>BTW it doesn't seem to happen if I don't accept. I'm debugging this behaviour in yaws with SSL but it also seems to happen with plain gen_tcp.</div>
<div><br></div><div>JD</div></div>