In terms of TCP/IP in general and the IBM/CSI VSE stack in particular:
Each TCP/IP connection starts with one "listener" which sits on a
particular IP address and port. When a remote client requests the
matching IP address and port, the two are matched-up and a connection is
established. If a second client simultaneously requests the same IP and
port, its request is rejected because the "listener" was "used up" by
the first client. In most cases, the server side will quickly establish
another "listener", either when the current transaction is finished or
as soon a the "listener" is converted to an established connection.
The best practice is to maintain multiple "listeners" so that one is
always available to field every client's request. There is no limit
(other than practical) on the number of "listeners" for any given IP
address and port combination. The only consideration is that you have
no control over which listener will be used first, so all listeners on a
port must do the same thing.
The method for creating multiple listeners depends on the stack API
being used.
If your server application is using the BSD API, then the BSD overhead
layer will perform listener overlap to whatever degree the application
requests.
If your server application is written at the more basic "socket" level,
then you have two choices:
1. Issue multiple passive OPENs to match the level of concurrent
connections you desire.
2. Tell the stack (via the PORTQUEUE command) how many connection
requests it should queue.
When port queuing is in effect (for a given port) and there is no
"listener" available, the stack will create a "pseudo listener" each
time a connection request is received. When the local server
application eventually does issue a "listen" it is immediately matched
with a oldest queued connection request. Note that this activity is
invisible to both the client and server, so it will work with any API.
You should also keep in mind that not all client applications behave in
what mainframers would consider to be a reasonable manner. For example,
it is not uncommon to see a web browser issue three simultaneous open
requests, use the first one established, and then abandon the other two.
It may also hold one or more of the connections open for 10 or fifteen
minutes before allowing it to close.
If anyone wants more detailed information, please contact me off-list
with particular questions.
Ed Franks