A Client Server Diagram: Sending Commands and Responses

The diagram given below shows a simple example of a Client - Server connection and a series of function calls used to send commands and responses.

Client

Action

Server

L_InetStartUp

Initialize the LEADTOOLS Peer-to-Peer DLL.

L_InetStartUp

 

Set the computer to act as a server and listen for connection requests

L_InetServerInit

L_InetConnect

-------------------------------------------------->
The client requests a connection with the server. This generates a call to the L_InetAcceptConnect on the server.

 

L_InetConnect

<--------------------------------------------------
The server accepts the connection request. This generates a call to the L_InetConnect function on the client.

L_InetAcceptConnect

 

The server must override the L_InetSetCommandCallback function so it will be notified of commands received from the client. The client must override the L_InetSetResponseCallback function so it will be notified of responses received from the server.

 

L_InetSendLoadCmd

-------------------------------------------------->
The client sends a load command to the server to load a specific image. This generates a call to the L_InetSetCommandCallback on the server.

L_InetSetCommandCallback

L_InetSetResponseCallback

<--------------------------------------------------
The server receives the load command and responds by calling L_InetSendLoadRsp. This generates a call to the L_InetSetResponseCallback function on the client.

L_InetSendLoadRsp

L_InetSendCmd

-------------------------------------------------->
The client sends a flip command using the L_InetSendCmd function. This generates another call to the L_InetSetCommandCallback function on the server.

L_InetSetCommandCallback

L_InetSetResponseCallback

<--------------------------------------------------
The server calls LInet::SendRsp in response to receiving the L_InetSendCmd call from the client. This generates another call to the L_InetSetResponseCallback function on the client.

L_InetSendRsp

L_InetSendSaveCmd

-------------------------------------------------->
The client sends a save command using the L_InetSendSaveCmd function. This generates another call to the L_InetSetCommandCallback function on the server.

L_InetSetCommandCallback

L_InetSetResponseCallback

<--------------------------------------------------
The server calls L_InetSendSaveRsp in response to receiving the L_InetSendSaveCmd call from the client. This generates another call to the L_InetSetResponseCallback function on the client.

L_InetSendSaveRsp

L_InetClose

The client has finished sending all the commands and closes the connection to the server.