: One socket connection, several client requests?

: One socket connection, several client requests?

Post by Mike McAda » Mon, 23 May 1994 06:07:47

I have a TCP/IP application where a client machine may be
sending several (100 a minute) separate small requests in
the form of 20 bytes to a server across the network.  Each
request requires only one short response, and may wait five
or more seconds for it.

I'm currently using a connection-oriented server.  For each
new request, the client connect()s to the server, the server
fork()s, a new socket descriptor is returned, and the client
and server interact over the new socket descriptor...

It was suggested that due to the volume and frequency of
requests, that the number of connect()s required is
not efficient.  

It was then suggested that we could send several requests
across an already open connection, and only open a new socket
when the number of requests per socket reached a predefined
number, say five.

The client processes would need to keep track of which response
goes with which request using a request id in the request,
which the server would copy and pass back with the response.
The server would still fork a new process for each request,
and each of those processes would be able to write on the
one socket descriptor.

Does this sound reasonable?  The suggestion was made to
reduce the connect()s, and improve response times for clients,
who wouldn't be waiting the extra time that it takes for
connections to be established.

However, I have never heard of this being done before, and
I'm just a bit skeptical.  

If anyone does respond, feel free to refer to any of Richard
Stevens' books.  


+               +------------------------------------------------+
+               | Insert something witty here                    |


1. After MaxClient Connection, What will happend to the Client Connection Request?

Hey Everyone,

We are using the Apache Server.  We set the MaxClient value to 256.
In that case, Whats going to happend after 256 Client Connections are
established in the server?.

Will the server starts dropping the Connection?.  I tried to test that out.
But I looks like the server stops dropping the connection somewhere around
380 Connection.?

In this case, What happend to those (380-256) Connections?.  And the request
that has sent after MaxClient has been reached, was having a large latency.

Any Clues?


2. PPP connects but only lets me telnet (not ping or anything lese) from Linux 2.0slack96

3. Server that proceses several client requests in UDP

4. support for NCR voyager (3/4/5xxx series)

5. Sockets- one server and many clients, how do I name all the clients

6. custom 401 error page

7. Why Multiple Socket Connections on one Connection....

8. Commercial Renterent Yacc package

9. Sharing an internet connection to several windows clients

10. Opening a socket connection while in a socket connection.

11. One NFS connection fine, one NFS connection slow

12. Multilink PPP with one fixed connection, and one PPPoE connection

13. check requested socket connection