Subject: | Re-binding, when it's not necessary (accept error: 53 on FreeBSD) |
In SimpleHTTP's SetupListener the SocketFactory is created with an error
handler (FailureEvent) of ListenerError.
ListenerError unconditionally calls SetupListener if it gets executed,
but this is wrong.
In my case, the execution gets to ListenerError with an error of (DEBUG
output):
"SocketFactory Wheel 1 generated accept error 53: Software caused
connection abort"
which means (AFAIK) that the other side has closed the connection,
before POE could accept() it, so this is not an error.
But because of calling SetupListener (which will call ListenerError
again, because it can't bind to the already used port, which in turn
call it again) the program will eventually die, when the maxtry entry
has reached.
I guess in ListenerError this case should be handled (maybe a call to
$_[HEAP]->{'SOCKETFACTORY'}->getsockname to see whether the socket is
there and if it is, don't try to set it up again).
Thanks