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 Internet 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 INETCALLBACK on the server.

INETCALLBACK

INETCALLBACK

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

L_InetAcceptConnect

L_InetSetResponseCallback

The server sets an INETCOMMANDCALLBACK function using L_InetSetCommandCallback so it will be notified of commands received from the client. The client sets an INETRESPONSECALLBACK function using L_InetSetResponseCallback so it will be notified of responses received from the server.

L_InetSetCommandCallback

L_InetSendLoadCmd

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

INETCOMMANDCALLBACK

INETRESPONSECALLBACK

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

L_InetSendLoadRsp

L_InetSendCmd

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

INETCOMMANDCALLBACK

INETRESPONSECALLBACK

<-------------------------------------------
The server calls L_InetSendRsp in response to receiving the L_InetSendCmdcall from the client. This generates another call to the INETRESPONSECALLBACK function set on the client.

L_InetSendRsp

L_InetSendSaveCmd

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

INETCOMMANDCALLBACK

INETRESPONSECALLBACK

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

L_InetSendSaveRsp

L_InetClose

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