The client IPC API library module has the file name ipclient.c. This module provides a high level IPC interface for a client application. The Unix version of this API uses the TCP Berkeley sockets (BSD) interprocess communication method. The Windows version of this API uses the TCP Winsock interprocess communication method. The QNX 4.x version uses its own message passing IPC method. This module contains global client data depending on the platform.
Any mention of QNX in this documentation refers to the QNX 4.x OS.
Starting in GPL package version 1.33, this module has been re-written to connect once and keep the socket open until closed or upon a socket communication error. Note that this re-write applies to the TCP IPC method only.
Here is a list of functions in the client IPC API library module:
The following modules are required along with this module:
Just make sure you compile and link this module along with the other required modules.
This module requires the header files:
TCP Proto : int ipc_set_active(char *host_name, int port_number) QNX Proto : int ipc_set_active(char *host_name) Parameters : Name : host_name Description: host name of server (TCP) or nameloc name (QNX) Name : port_number Description: TCP port number of server Returns : TRUE upon success, FALSE otherwise
This function will load the host_name and port_number into the module global data variables making these values the current server specification. The TCP variant will also close any open socket and connect to the specified server. Since the QNX message passing IPC method does not have the concept of a port number, this parameter does not exist for this platform.
TCP Proto : int ipc_get_active(char *host_name, int *port_number) QNX Proto : int ipc_get_active(char *host_name) Parameters : Name : host_name Description: returned host name of server (TCP), nameloc name (QNX) Name : port_number Description: returned port number of server Returns : TRUE upon success, FALSE otherwise
This function will obtain the host name and port number of the currently defined server. Since the QNX message passing IPC does not have the concept of a port number, this parameter does not exist for this platform.
TCP Proto : int ipc_send_receive(char *sbuf, char *rbuf) QNX Proto : int ipc_send_receive(char *sbuf, char *rbuf, int size_rbuf) Parameters : Name : sbuf Description: send data buffer Name : rbuf Description: returned receive data buffer Name : size_rbuf Description: size (in bytes) of the receive buffer Returns : TRUE upon success, FALSE otherwise
This function will connect to the currently defined server, transmit the send data buffer and wait for the receive data buffer. Upon success, the receive data buffer will be returned. The receive data buffer must already be allocated to sufficient size by the caller.
Prototype : int ipc_close(void) Returns : TRUE upon success, FALSE otherwise
This function will close the client socket. This function applies to TCP IPC method only.
Prototype : static int ipclient_connect(void) Returns : TRUE upon success, FALSE otherwise
This private function will attempt to connect to the currently defined socket server. This function applies to TCP socket IPC method only.