Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Development Topics > Socket Programming > Scenarios and Issues

Simple, Blocking, Iterative Server

Scroll Prev Top Next More

This scenario reflects one of the most common types of socket conversations, that of a server which fulfills a single request per client connection. An example might be an inventory lookup and pricing server. The client prepares a request (e.g. perhaps a list of part numbers and quantities.) It then connects to the server (which spends its time in waiting for such connections, except when it is actually busy servicing one.) If the connection fails, the client might wait and retry. Upon connection, the client passes the list of parts and quantities to the server, the server looks them up in the inventory and pricing databases, and then returns the list updated with the available quantities and current prices. The client then terminates the conversation and the server goes back to waiting for another client connection.

There is nothing in this model requiring that the conversation be terminated after one request/reply cycle.

A flow diagram representing this kind of conversation and indicating the actual TCPCLIxs and TCPSRVxs opcodes is given below. TCPXxs supports the same opcodes, so the references to TCPCLI and TCPSRV in the diagram apply equally to TCPX).

ashref_img89