Re: Socket holding pattern

From: Uri Guttman (uri_at_stemsystems.com)
Date: 09/09/04


Date: Thu, 09 Sep 2004 13:49:29 GMT


>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:

  AS> Another possibility is to open the relevant file handles (sockets)
  AS> so that they are immune to close-on-exec. (Set $^F to something
  AS> huge while they are opened). The old server process would have
  AS> to tell the new one which file descriptors are in use, so the new
  AS> one can take them over. Besides the compatibility issues already
  AS> mentioned, there may be synchronization problems when both processes
  AS> hold file handles to active connections.

it can be much harder than that too. most servers of this type (long
lived connections) keep state about each connection so that has to be
stored in a place away from the socket itself. if that data is in
objects and you reload that class, who knows what will happen to those
objects? the newly loaded code would always need to know it is fresh and
reload those objects and such. this idea of reloading code on the fly
and keeping connections is not for the feint of heart nor the weak in
coding and design skills.

and i agree, since this is only for a mud, who cares? kick all the
players and let them reconnect.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


Relevant Pages

  • sockets, closing and TIME_WAIT
    ... During heavy load the server can't follow anymore because the sockets ... my server should be able to handle 10 clients connecting ... This gets a free position in the array of connections, ...
    (comp.unix.programmer)
  • Re: network programming: how does s.accept() work?
    ... The program you contact at Google is a server. ... so, the server will usually assign a new port, say 56399, specifically ... connections to a server remain on the same port, ... sockets is what identifies them. ...
    (comp.lang.python)
  • Re: FOAK: ADSL Micro Filters
    ... what is the REN total of the units plugged into the sockets. ... I've always had terrible problems with our connections, ... and whether the new adsl modem was connected or not. ... IIRC to use UK bought phones in France, ...
    (uk.rec.motorcycles)
  • socket_select() hangs sometimes; Bug?
    ... socket_selectfor accepting new connections and dealing with existing ... The select runs on all connected sockets for read and ... the server hangs after some time. ...
    (php.general)
  • Re: high performance with a lot of outgoing connections
    ... >> outgoing connections, and it is possible to run the system out of ... >> ports under certain circumstances. ... >> a normal web server, or has a limited number of outgoing connections, ... As an option to get you more sockets. ...
    (comp.unix.bsd.freebsd.misc)