Re: one-to-one client server design



Capstar wrote:
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.
Fork off a child to handle each connection. That way
you can service clients concurrently.

If you don't want to do that, still fork off /one/ child
to handle the connection, have the parent accept new ones, tell
them why they arn't allowed and close the connection (or queue them up)
until the child is finished.
.



Relevant Pages

  • Re: Connection lost at same time every hour (sometimes)
    ... After making the two following alterations on the server the problem seems ... After analyze your ipconfig on SBS and client, ... Then, other connection is good, ...
    (microsoft.public.windows.server.sbs)
  • Re: server disconnection - very often
    ... Reason of permanent popups is VMware server aplication on clients. ... Run CEICW to configure the network of SBS: ... Two network adapters - manual router connection to broadband ... Uninstall VMware on client. ...
    (microsoft.public.windows.server.sbs)
  • Re: Lan setup 2 nic
    ... The external nic only has TCP/IP enabled. ... Ipconfig of the server is looking good, but the client is still missing the ... > connection so we have a 2 nic with router setup now. ...
    (microsoft.public.windows.server.sbs)
  • Re: Regular disconnections from remote web workplace
    ... I can connect to office server and all office clients from home at all times ... be physically working right up until the connection is lost. ... If I enter http://companyip from a client I receive the login screen for the ... Click Services tab and select Hide All Microsoft Services and Disable ...
    (microsoft.public.windows.server.sbs)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #3]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... kernel socket family. ... presentation side is left to the client. ... Each connection goes to a particular "service". ...
    (Linux-Kernel)