Re: one-to-one client server design



kondal schreef:
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.

Thanks,
Mark

The problem you projected uses N-1 client server relation (N clients to
1 server). It is not one-to-one. If it is one-to-one you do not need to
worry about the other client coming in.

Initial handshake is the general method used. I used token passing
method to all the clients so that they wait till they receive the token
(generally a counter).

Just wondering what would be the reson not to use concurrent
programming method here unless you are accessing a device that is not
concurrent (or similar).

-kondal


I called it a one-to-one relation because the server can only actively handle one connection. The server runs on a recording system and commands from a client can change the state of the system. The state is also persistent between connects.
The design of the system demands that when a client sends a command to the server that would change the state of the system and the server acknowledges the command, that the system is from that point on in a known state. If another client could also connect and change the state of the system there's no way to be certain what the state of the system is.

I think handshaking would suffice to do what I need. But can you elaborate on the token passing method? Does this mean that the server basically asks the client for a command by passing it a token?

Mark

.



Relevant Pages

  • [REVS] Backdoor Spotcom Analysis
    ... Spotcom is a backdoor client application that allows a hacker to control ... The server IP address is hard-coded in ... msrsvp.exe accepts a couple of command line arguments. ... the packet payload. ...
    (Securiteam)
  • Re: .Net Scalability problem
    ... LoadRunner will peak out a server with a few virtual users. ... To get an idea of load, ... Fire off the test client and watch the number of ... > So I think that the MTC generate concurrent connection and per ...
    (microsoft.public.dotnet.framework.adonet)
  • 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)