in reply to Restarting a script without dropping clients
server <--> proxy <--> clients
When you need to restart the server, just send the proxy a special message saying "buffer all client connections until the new server boots". Then kill the server and restart with new code. The server connects to the proxy and resumes talking to the clients who are none the wiser.
Another, much more drastic, option would be to use UDP sockets instead of TCP sockets. UDP sockets are connectionless and you can restart your server as much as you want without disturbing clients. However, UDP sockets require you to handle retransmission when packets are lost and don't guarantee ordered delievery of packets, so there's definitely a downside here.
-sam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Restarting a script without dropping clients
by MidLifeXis (Monsignor) on Dec 15, 2003 at 18:26 UTC |