You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-users@mina.apache.org by Martin Wunderlich <ma...@censhare.de> on 2013/10/24 15:16:51 UTC

How explicitly free ports on server close?

Hi all, 

We have noticed that the FTP server doesn't seem to release it's used ports when the close() method is called. The result is that the server can't be restarted, because its ports are already in use.  
Is this the normal behavior and, if yes, how can I tell the FTP server to release the ports? Should one set server == null after closing the server? 

Kind regards, 

Martin 



Re: How explicitly free ports on server close?

Posted by Sai Pullabhotla <sa...@jmethods.com>.
If you stop the server, wait for a minute or two and then start, does it
start okay? If so, it may have to do with the SO_REUSE policy. If you set
Socket Reuse to true, you should not have this problem.

Please see this for more information:

http://docs.oracle.com/javase/7/docs/api/java/net/ServerSocket.html#setReuseAddress(boolean)





On Thu, Oct 24, 2013 at 8:16 AM, Martin Wunderlich <ma...@censhare.de> wrote:

> Hi all,
>
> We have noticed that the FTP server doesn't seem to release it's used
> ports when the close() method is called. The result is that the server
> can't be restarted, because its ports are already in use.
> Is this the normal behavior and, if yes, how can I tell the FTP server to
> release the ports? Should one set server == null after closing the server?
>
> Kind regards,
>
> Martin
>
>
>