There's a program listening and answering requests (proprietary binary protocol) in a TCP/IP port. But this program needs to be updated and so it needs to be restarted and then it can continue doing its work on the same port.
According to its protocol, all current connections can be closed because all clients will re-establish new connections right after they are closed, but new connections should be retained (but not denied) until the program has been restarted (for a few seconds), how could it be done?
So, as soon as it is running again all retained connections on a given port could be released to reach the listening socket.
Let's imagine the following steps:
- A server program is running and listening to a given port, let's say port A.
- It asks to an external resource (like the operational system or any third party module) to retain all connections coming to the port A.
- It closes all current connections that is currently established to the port A - IT MIGHT TAKE TIME (maybe a couple of minutes, because it will finish first all requested services)
- It's restarted and a brand new executable comes to life and starts to listen to the port A.
- It asks to the external resource to release all retained connections, so they can now reach the port A, that is now ready to receive connections.
The steps 2 and 4 are just assumptions.