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

LInet::StartUp

Initialize the LEADTOOLS Internet DLL.

LInet::StartUp

 

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

LInet::ServerInit

LInet::Connect

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

 

LInet::OnConnect

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

LInet::AcceptConnect

 

The server must override the LInet::CommandCallBack function so it will be notified of commands received from the client. The client must override the LInet::ResponseCallBack function so it will be notified of responses received from the server.

 

LInet::SendLoadCmd

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

LInet::CommandCallBack

LInet::ResponseCallBack

<--------------------------------------------------
The server receives the load command and responds by calling
LInet::SendLoadRsp. This generates a call to the LInet::ResponseCallBack function on the client.

LInet::SendLoadRsp

LInet::SendCmd

-------------------------------------------------->
The client sends a flip command using the LInet::SendCmd function. This generates another call to the
LInet::CommandCallBack function on the server.

LInet::CommandCallBack

LInet::ResponseCallBack

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

LInet::SendRsp

LInet::SendSaveCmd

-------------------------------------------------->
The client sends a save command using the LInet::SendSaveCmd function. This generates another call to the LInet::CommandCallBack function on the server.

LInet::CommandCallBack

LInet::ResponseCallBack

<--------------------------------------------------
The server calls
LInet::SendSaveRsp in response to receiving the LInet::SendSaveCmd call from the client. This generates another call to the LInet::ResponseCallBack function on the client.

LInet::SendSaveRsp

LInet::Close

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

LInet::OnClose