one-to-one client server design
- From: Capstar <news@xxxxxxxxxxxxx>
- Date: Mon, 25 Sep 2006 10:23:58 +0200
Hi NG,
I'm designing a client server architecture in which the client and the server have a one-to-one relation.
My first try was to do an accept to obtain the socket to the client and work on that until the connection is closed. Than I'd call accept again and to the same thing.
This is not an acceptable solution though since any new connection can be pending for quite a long time since the server doesn't do anything with them.
My first solution would be to close the server socket the moment a connection is established so the entire service would be unavailable for the duration of the connection. This way new clients will fail to connect. This solution doesn't feel right since new clients will not know why the connection failed.
I guess the best way would be to have some handshaking just after a connection is established to tell the client if the connection is allowed or not. Although this is easy enough to implement I was wondering if this is really the way to go or if there's another more common way of doing it.
Thanks,
Mark
.
- Follow-Ups:
- Re: one-to-one client server design
- From: "Nils O. Selåsdal"
- Re: one-to-one client server design
- From: kondal
- Re: one-to-one client server design
- Prev by Date: Re: typedef in a struct
- Next by Date: Binary Source Code
- Previous by thread: game monitor app
- Next by thread: Re: one-to-one client server design
- Index(es):
Relevant Pages
|