The send and receive support functions

To handle opaque-type data in its external binary representation, the database server calls the send and receive support functions for the opaque type.

When a client application sends or receives opaque-type data in its internal representation, the database server must find a support function to handle the possibility that the client computer uses a different byte ordering than the server computer. The send and receive support functions are the cast functions for an opaque type between its internal representation on a client computer and its internal representation on the server computer.

The database server stores the client internal representation of an opaque type in an mi_sendrecv structure. The mi_sendrecv structure is a varying-length structure that encapsulates the client internal representation. Its ability to store varying-length data enables it to handle any possible changes in the size of the opaque-type data when it is converted between these two internal representations. For example, the client and server computers might have different packing rules for structures. Because the mi_sendrecv data type is a varying-length structure (like mi_lvarchar), it is always passed by reference. Therefore, the send and receive support routines cast the data as follows.
Opaque-type support function Cast from Cast to
Send Server internal representation of the opaque data type mi_sendrecv *
Receive mi_sendrecv * Server internal representation of the opaque data type

The database server receives a description of the client computer when the client application establishes a connection. The DataBlade® API provides several functions that access this information for use in send and receive functions. For more information, see Conversion of opaque-type data with computer-specific data types.