Page 1 of 1
Extend CreateNetworkServer() in Linux ...
Posted: Thu Oct 28, 2021 9:46 pm
by infratec
If you have to restart a PB TCP server it needs between 30 and 90 seconds to be able to use the port again.
In detail:
viewtopic.php?f=15&t=78140
So please add SO_REUSEADDRESS to the CreateNetworkServer() code.
My fix is ugly and not the best solution.
Maybe this should be done in the other OSs as well.
Re: Extend CreateNetworkServer() in Linux ...
Posted: Fri Oct 29, 2021 4:06 am
by Bitblazer
This might actually create problems for other TCP servers. Beware of side effects of using SO_REUSEADRESS in
general!
An easier way of being able to
optionally use socket flags could however be useful
IF it can be added in a backward compatible way.
Adding useful examples of how to use
ss on *nix sockets could be an useful addition to the manual, but again that would be really for advanced users. It might just be out of the scope of a pure
basic manual ....
A strong -1 for adding SO_REUSEDRESS in
general
Re: Extend CreateNetworkServer() in Linux ...
Posted: Fri Oct 29, 2021 6:59 am
by infratec
ss was not useful and I don't want to call additonal programs for 'garbage collection'.
You can extend my 'not working' example in the linked thread to make it work.
I'm open for any other solution.
What side effects has it for a server?
If you restart any server you want that it comes up fast again after a restart.
My used SO_LINGER as fix has more disadvantages then SO_REUSEADDRESS
But Ok, it can be realized as optional flag in CreateNetworkServer()
Code: Select all
#PB_Network_TCP | #PB_Network_TCP_ReuseAddress