gtpc1m3cTransmission Control Protocol/Internet Protocol

Using the activate_on_receipt Function Call

The TPF system provides the activate_on_receipt function, a unique TPF socket API function designed to prevent many ECBs from being suspended at the same time. See the drivers in Appendix D, Sample Application Driver Code for an example of how to use the activate_on_receipt function. The following steps correspond to the numbers in Figure 24:

  1. The server is started first by issuing a socket call to create socket s. The client then issues a socket to create its own socket s. A socket is initially created in the unconnected state, which means that the socket is not associated with any remote destination.
  2. Using the listen function, the server issues a bind call to a local address to be positioned for a subsequent connection.

    The client can issue an optional bind call to a local address.

  3. The server waits for a connection from the client.
  4. The connect call places the socket in the connected state. The client must issue the connect call before being able to transfer data through a reliable stream socket.
  5. The server issues an accept call to accept an incoming connection. To allow the server socket s to remain available for the next client connection, the accept call creates a new socket ns, which is dedicated to the client.
  6. The server issues an activate_on_receipt function to create a new ECB and activate a new child server program when data is received from the client. The original server becomes a parent server.
  7. When the child server program is activated, the read and write calls between the client and child server continue until all the data is transferred.
  8. The client closes socket s and the child server closes the related socket, socket ns. The parent server can continue to accept other connections on the original socket s or close it.

Figure 24. Using the activate_on_receipt Function Call