The TCP client socket API library module has the file name ipclient.c. This module provides a high level TCP socket interface for a TCP client application. The Unix version of this API uses the TCP Berkeley socket interprocess communication method. The Windows version of this API uses the Winsock interprocess communication method. This module contains global client socket data depending on the platform. The Future Lab TCP socket API library (both client and server) use the TCP connection oriented protocol.
Since the Future Lab QNX platform software does not (yet) use TCP for interprocess communication (QNX native message passing is the IPC), this module is not available for QNX.
Here is a list of functions in the TCP client socket 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:
Prototype : int ipc_set_active(char *host_name, int port_number) Parameters : Name : host_name Description: host name of server Name : port_number Description: 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 socket server specification.
Prototype : int ipc_get_active(char *host_name, int *port_number) Parameters : Name : host_name Description: returned host name of server 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 socket server.
Prototype : int ipc_send_receive(char *sbuf, char *rbuf) Parameters : Name : sbuf Description: send data buffer Name : rbuf Description: returned receive data buffer Returns : TRUE upon success, FALSE otherwise
This function will connect to the currently defined socket 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.
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.