Hi Hermann-Josef, depends what you want to do. Option one might be a good possibility (you should then recreate the server socket using kReuseAddr). Case 2 is also an option, instead of directly closing you could send back a message stating why you are closing, etc. There is no special option to accept only one connection except closing the server socket and recreating it. Cheers, Fons. On Friday 16 November 2001 16:03, mathes@ik3.fzk.de wrote: > Dear Rooters, > > one question concerning the class TServerSocket (or sockets at all): > > What is the preferred way of server implementation if the server should > allow only one client to connect ? The server should allow a new > connection if the first client has disconnected. > 1. delete the prototype socket (class TServerSocket) after the first > Accept() has been done -> then I have to create a new TServerSocket to > fulfill the 2nd requirement ... > 2. Accept() more connections but close the resulting TSocket > immediately ? > 3. set any option of the TServerSocket ? if, which one ? > > Thanks for any helpful comment. > > Hermann-Josef > > ************************************************************************** > * * > * Dr. Hermann-Josef Mathes * > * KASCADE & AUGER Collaboration * > * Forschungszentrum Karlsruhe Phone: +49 7247 822429 * > * Institut fuer Kernphysik FAX: +49 7247 824075 * > * POB 3640 * > * D-76021 Karlsruhe/Germany Mail: mathes@ik3.fzk.de * > * hjmathes@web.de * > * * > * Feel free to visit my homepage: * > * http://www-ik3.fzk.de/~mathes/Welcome.html * > ************************************************************************** -- Org: CERN, European Laboratory for Particle Physics. Mail: 1211 Geneve 23, Switzerland E-Mail: Fons.Rademakers@cern.ch Phone: +41 22 7679248 WWW: http://root.cern.ch/~rdm/ Fax: +41 22 7679480
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:08 MET