[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] ssh_bind_listen() does not fail in windows when port is in use


Ok, but in case of a restart, you have to wait quite a while.

I don't know what's the equivalent of lock files in Windows. But maybe
you wrap it as a service - then you can't start it twice at least. But
still, another application could open a socket for the same address /
port of course...

>
> This way I set my own fd which does not have SO_REUSEADDR set in it.
>
> On Thu, Mar 21, 2019 at 4:40 PM <g4-lisz@xxxxxxxxxxxx
> <mailto:g4-lisz@xxxxxxxxxxxx>> wrote:
>
>     On 22.03.19 00:15, Alberto Garcia wrote:
>     > The socket has the SO_REUSEADDR so it does not fail when it is
>     in use.
>     > I don't know why that's set. Does anyone knows what is the intention
>     > of it?
>
>     Look here:
>     https://stackoverflow.com/questions/577885/what-are-the-use-cases-of-so-reuseaddr
>
>     I think it's for the reason the guy there explains: To be able to
>     reconnect to the same socket without having to wait until TIME_WAIT
>     state is over.
>
>
>
>
> -- 
> Alberto García Illera
>
> GPG Public Key <https://goo.gl/yshdwh>

Archive administrator: postmaster@lists.cynapses.org