Hi Nicolas,

On 4/18/07, Nicolas FROMENT <[EMAIL PROTECTED]> wrote:
Hi !
First, congratulations for the 1.0.3 and 1.1 releases.
Second, a problem I encounter again... Unbinding on Linux.
My problem is that when I do a restart on my service, I can bind on the
address (Address already in use). No problem on windows.

Could you try again with the following configuration code:

SocketAcceptorConfig cfg = ...;
cfg.getSessionConfig().setReuseAddress(true);

A question : Is SocketAcceptor.unbindAll() synchronous ? I mean
everything is unbind after the call ?

Yes.  If not, it's a bug.  You could try to connect to the port you
unbound to test it's really unbound.

Second my testcase is attached. I change the Reverser example to show my
problem The protocol handler is the same one : reverseProtocolHandler.
And my main attached is Server.java. As you see I bind (localhost,
8080). Connect a client socket. UnbindAll. And try to rebind.
Running it on linux lead to a java.net.SocketException: Address already
in use.
Of course, if I don't connect a client, everything runs fine.

I know there was a bug (DIRMINA-366) and a long discussion about this
subject. But the bug is closed in 1.0.3 and the discussion seems to be
close.
Maybe I miss something during the discussion... Could you please tell me
what ?

I guess this problem still exists if you specify a IoServiceConfig in
bind() call.  Please try the configuration code above and let me know
if it works.  If so, we need to reopen the issue.

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to