Sending Commands and Responses

LEADTOOLS provides a number of functions that allow you to send commands and responses between a local and a remote computer. This provides a means of using a "super computer" to store and process large numbers of images, while using a smaller, remote computer to send commands indicating which process to perform and which image to use.

In order to receive commands, an INETCOMMANDCALLBACK function should be set using the L_InetSetCommandCallback function, on the computer that will be receiving commands. If an INETCOMMANDCALLBACK function is not set, the INETCALLBACK function will be used by default for receiving commands. INETCALLBACK is not suitable for handling command parameters and extra data, so it is best to set an INETCOMMANDCALLBACK function. The supported command functions include the following:

L_InetSendCmd

L_InetSendLoadCmd

L_InetSendSaveCmd

L_InetSendCreateWinCmd

L_InetSendAttachBitmapCmd

L_InetSendSizeWinCmd

L_InetSendCloseWinCmd

L_InetSendShowWinCmd

L_InetSendSetRectCmd

L_InetSendFreeBitmapCmd

L_InetSendGetMagGlassDataCmd

When a computer receives a command, the INETCOMMANDCALLBACK function is called. The computer that receives the command should then send a response to the computer that sent the command. The supported response functions include the following:

L_InetSendRsp

L_InetSendLoadRsp

L_InetSendSaveRsp

L_InetSendCreateWinRsp

L_InetSendAttachBitmapRsp

L_InetSendSizeWinRsp

L_InetSendCloseWinRsp

L_InetSendShowWinRsp

L_InetSendSetRectRsp

L_InetSendFreeBitmapRsp

L_InetSendGetMagGlassDataRsp

To receive responses, the computer that sent the original command should also set an INETRESPONSECALLBACK function using L_InetSetResponseCallback.

While the L_InetSendLoadCmd, L_InetSendLoadRsp, L_InetSendSaveCmd, L_InetSendSaveRsp, etc. provide standard image processing commands and responses, the L_InetSendCmd and L_InetSendRsp functions provide a means of creating user-defined commands and responses. These commands and responses may require sending extra data, in the form of a packet, along with the command or the response. LEADTOOLS provides the following functions for creating and freeing packets: L_InetCreatePacket, L_InetCreatePacketFromParams and L_InetFreePacket. For a diagram of a client server set-up for sending commands and responses, refer to A Client-Server Diagram: Sending Commands and Responses.