Thanks for the explanation, but my i think you missunderstood my problem
So do I get this right?
When the client application gets closed, you are calling ::close on the TcpListener of your server application?
No when the server application gets closed.
Ther server works fine, multiple clients are no problem and I dont close the Listener when a client disconnects, I disconnect the client socket.
My problem occurs when i shutdown the server to install an update or something like that. I do that this way:
1)I send a packet to my server wich contains the message to shutdown
2)The server closes all client sockets
3)The server closes the listener
4)The app reaches the return of the "main"
Then i replace the executable with the new version. And now, when I start the new version, I get the Error: "Cant bind Port xxxx".
So it looks like the old instance still blocks the Port but the old instance isnt running anymore.
The strange thing is that this "bug" online happens under Linux on my PC/Windows I can open/close the server without problems.
AlexAUT