Connection Functions (TipcCbConn* and TipcConn*)


The TipcCbConn* and TipcConn* functions are used when you need to do direct peer-to-peer communication between two programs, without going through RTserver.

Callback Functions

These functions are used to work with callbacks on connections. For subject callbacks, see Global Connection Callback Functions (TipcCbSrv* and TipcSrv*Cb*).

TipcCbConnProcessGmdFailure — callback on all connections to process guaranteed message delivery failure messages when GMD fails

void TipcCbConnProcessGmdFailure(conn, data, arg) 
T_IPC_CONN conn; 
T_IPC_CONN_PROCESS_CB_DATA data; 
T_CB_ARG arg; 

TipcCbConnProcessKeepAliveCall — callback to process KEEP_ALIVE_CALL messages from the other end of a connection

void TipcCbConnProcessKeepAliveCall(conn, data, arg) 
T_IPC_CONN conn; 
T_IPC_CONN_PROCESS_CB_DATA data; 
T_CB_ARG arg; 

TipcConnDefaultCbCreate — create a default callback in a connection

T_CB TipcConnDefaultCbCreate(conn, func, arg) 
T_IPC_CONN conn; 
T_IPC_CONN_DEFAULT_CB_FUNC func; 
T_CB_ARG arg; 

TipcConnDefaultCbLookup — look up a default callback in a connection

T_CB TipcConnDefaultCbLookup(conn, func, arg) 
T_IPC_CONN conn; 
T_IPC_CONN_DEFAULT_CB_FUNC func; 
T_CB_ARG arg; 

TipcConnErrorCbCreate — create an error callback in a connection

T_CB TipcConnErrorCbCreate(conn, func, arg) 
T_IPC_CONN conn; 
T_IPC_CONN_ERROR_CB_FUNC func; 
T_CB_ARG arg; 

TipcConnErrorCbLookup — look up an error callback in a connection

T_CB TipcConnErrorCbLookup(conn, func, arg) 
T_IPC_CONN conn; 
T_IPC_CONN_ERROR_CB_FUNC func; 
T_CB_ARG arg;  

TipcConnProcessCbCreate — create a process callback in a connection

T_CB TipcConnProcessCbCreate(conn, mt, func, arg) 
T_IPC_CONN conn; 
T_IPC_MT mt; 
T_IPC_CONN_PROCESS_CB_FUNC func; 
T_CB_ARG arg; 

TipcConnProcessCbLookup — look up a process callback in a connection

T_CB TipcConnProcessCbLookup(conn, mt, func, arg) 
T_IPC_CONN conn; 
T_IPC_MT mt; 
T_IPC_CONN_PROCESS_CB_FUNC func; 
T_CB_ARG arg; 

TipcConnQueueCbCreate — create a queue callback in a connection

T_CB TipcConnQueueCbCreate(conn, mt, func, arg) 
T_IPC_CONN conn; 
T_IPC_MT mt; 
T_IPC_CONN_QUEUE_CB_FUNC func; 
T_CB_ARG arg; 

TipcConnQueueCbLookup — look up a queue callback in a connection

T_CB TipcConnQueueCbLookup(conn, mt, func, arg) 
T_IPC_CONN conn; 
T_IPC_MT mt; 
T_IPC_CONN_QUEUE_CB_FUNC func; 
T_CB_ARG arg;  

TipcConnReadCbCreate — create a read callback in a connection

T_CB TipcConnReadCbCreate(conn, mt, func, arg) 
T_IPC_CONN conn; 
T_IPC_MT mt; 
T_IPC_CONN_READ_CB_FUNC func; 
T_CB_ARG arg; 

TipcConnReadCbLookup — look up a read callback in a connection

T_CB TipcConnReadCbLookup(conn, mt, func, arg) 
T_IPC_CONN conn; 
T_IPC_MT mt; 
T_IPC_CONN_READ_CB_FUNC func; 
T_CB_ARG arg; 

TipcConnWriteCbCreate — create a write callback in a connection

T_CB TipcConnWriteCbCreate(conn, mt, func, arg) 
T_IPC_CONN conn; 
T_IPC_MT mt; 
T_IPC_CONN_WRITE_CB_FUNC func; 
T_CB_ARG arg; 

TipcConnWriteCbLookup — look up a write callback in a connection

T_CB TipcConnWriteCbLookup(conn, mt, func, arg) 
T_IPC_CONN conn; 
T_IPC_MT mt; 
T_IPC_CONN_WRITE_CB_FUNC func; 
T_CB_ARG arg; 

Accept, Create and Destroy Functions

These functions are used to accept connections from a client, create connections of different types, and destroy connections.

TipcConnAccept — accept a connection from a client

T_IPC_CONN TipcConnAccept(server_conn) 
T_IPC_CONN server_conn; 

TipcConnCreate — create a new connection

T_IPC_CONN TipcConnCreate() 

TipcConnCreateClient — create the client side of a connection

T_IPC_CONN TipcConnCreateClient(logical_conn_name) 
T_STR logical_conn_name; 

TipcConnCreateServer — create the server side of a connection

T_IPC_CONN TipcConnCreateServer(logical_conn_name) 
T_STR logical_conn_name; 

TipcConnDestroy — destroy a connection

T_BOOL TipcConnDestroy(conn) 
T_IPC_CONN conn; 

GMD Functions (Tipc*Gmd*)

These functions are used to work with the guaranteed delivery message services of SmartSockets for connections.

TipcConnGmdFileCreate — create a GMD area on a connection

T_BOOL TipcConnGmdFileCreate(conn) 
T_IPC_CONN conn; 

TipcConnGmdFileDelete — delete GMD files for a connection

T_BOOL TipcConnGmdFileDelete(conn) 
T_IPC_CONN conn; 

TipcConnGmdMsgDelete — delete a message from the GMD area after a GMD failure on a connection

T_BOOL TipcConnGmdMsgDelete(conn, msg) 
T_IPC_CONN conn; 
T_IPC_MSG msg; 

TipcConnGmdMsgResend — resend a message after a GMD failure on a connection

T_BOOL TipcConnGmdMsgResend(conn, msg) 
T_IPC_CONN conn; 
T_IPC_MSG msg; 

TipcConnGmdResend — resend all guaranteed messages after a delivery failure on a connection

T_BOOL TipcConnGmdResend(conn) 
T_IPC_CONN conn; 

TipcGetGmdDir — get name of the directory where files are written for GMD

T_STR TipcGetGmdDir() 

Miscellaneous Functions

These functions do not fit with any of the other established categories:

TipcConnCheck — check if data can be read from or written to a connection

T_BOOL TipcConnCheck(conn, check_mode, timeout) 
T_IPC_CONN conn; 
T_IO_CHECK_MODE check_mode; 
T_REAL8 timeout; 

TipcConnKeepAlive — check if the process at the other end of a connection is still alive

T_BOOL TipcConnKeepAlive(conn) 
T_IPC_CONN conn; 

TipcConnLock — acquire exclusive access to a connection

T_BOOL TipcConnLock(conn) 
T_IPC_CONN conn; 

TipcConnRead — read data from a connection and queue messages in priority order

T_BOOL TipcConnRead(conn, timeout) 
T_IPC_CONN conn; 
T_REAL8 timeout; 

TipcConnUnlock — release exclusive access to a connection

T_BOOL TipcConnUnlock(conn) 
T_IPC_CONN conn; 

Property Get Functions (TipcConnGet* and TipcConn*Get*)

The TipcConnGet* and TipcConn*Get* functions are used to retrieve the properties of a connection. A connection property is a piece of information about the connection, such as how often messages are expected to be available for reading.

TipcConnBufferGetReadSize — get the total number of bytes in a connection’s read buffer

T_BOOL TipcConnBufferGetReadSize(conn, read_size_return) 
T_IPC_CONN conn; 
T_INT4 *read_size_return; 

TipcConnBufferGetWriteSize — get the total number of bytes in a connection’s write buffer

T_BOOL TipcConnBufferGetWriteSize(conn, write_size_return) 
T_IPC_CONN conn; 
T_INT4 *write_size_return; 

TipcConnGetArch — determine the architecture name of a connection’s peer process

T_BOOL TipcConnGetArch(conn, arch_return) 
T_IPC_CONN conn; 
T_STR *arch_return; 

TipcConnGetAutoFlushSize — determine the automatic flush size of a connection

T_BOOL TipcConnGetAutoFlushSize(conn, auto_flush_size_return) 
T_IPC_CONN conn; 
T_INT4 *auto_flush_size_return; 

TipcConnGetBlockMode — determine the block mode of a connection

T_BOOL TipcConnGetBlockMode(conn, block_mode_return) 
T_IPC_CONN conn; 
T_BOOL *block_mode_return; 

TipcConnGetGmdMaxSize — determine the GMD area maximum size of a connection

T_BOOL TipcConnGetGmdMaxSize(conn, gmd_max_size_return) 
T_IPC_CONN conn; 
T_UINT4 *gmd_max_size_return; 

TipcConnGetGmdNumPending — determine the number of outgoing GMD messages still pending on a connection

T_BOOL TipcConnGetGmdNumPending(conn, gmd_num_pending_return) 
T_IPC_CONN conn; 
T_INT4 *gmd_num_pending_return; 

TipcConnGetNode — determine the node name of a connection’s peer process

T_BOOL TipcConnGetNode(conn, node_return) 
T_IPC_CONN conn; 
T_STR *node_return; 

TipcConnGetNumQueued — determine the number of queued messages from a connection

T_BOOL TipcConnGetNumQueued(conn, num_queued_return) 
T_IPC_CONN conn; 
T_INT4 *num_queued_return; 

TipcConnGetPid — determine the process ID of a connection’s peer process

T_BOOL TipcConnGetPid(conn, pid_return) 
T_IPC_CONN conn; 
T_INT4 *pid_return; 

TipcConnGetSocket — determine the socket of a connection

T_BOOL TipcConnGetSocket(conn, socket_return) 
T_IPC_CONN conn; 
T_INT4 *socket_return; 

TipcConnGetTimeout — determine the timeout property of a connection

T_BOOL TipcConnGetTimeout(conn, timeout, value_return) 
T_IPC_CONN conn; 
T_IPC_TIMEOUT timeout; 
T_REAL8 *value_return; 

TipcConnGetUniqueSubject — determine the unique subject of a connection’s peer process

T_BOOL TipcConnGetUniqueSubject(conn, unique_subject_return) 
T_IPC_CONN conn; 
T_STR *unique_subject_return; 

TipcConnGetUser — determine the user name of a connection’s peer process

T_BOOL TipcConnGetUser(conn, user_return) 
T_IPC_CONN conn; 
T_STR *user_return; 

TipcConnGetXtSource — get the source suitable for XtAppAddInput from a connection

T_BOOL TipcConnGetXtSource(conn, source_return) 
T_IPC_CONN conn; 
T_INT4 *source_return; 

TipcConnTrafficGetBytesRecv8 — get the total number of bytes received on a connection

T_BOOL TipcConnTrafficGetBytesRecv8(conn, bytes_recv_return) 
T_IPC_CONN conn; 
T_INT8 *bytes_recv_return; 

TipcConnTrafficGetBytesSent8 — get the total number of bytes sent on a connection

T_BOOL TipcConnTrafficGetBytesSent8(conn, bytes_sent_return) 
T_IPC_CONN conn; 
T_INT8 *bytes_sent_return; 

TipcConnTrafficGetMsgsRecv8 — get the total number of messages received on a connection

T_BOOL TipcConnTrafficGetMsgsRecv8(conn, msgs_recv_return) 
T_IPC_CONN conn; 
T_INT8 *msgs_recv_return; 

TipcConnTrafficGetMsgsSent8 — get the total number of messages sent on a connection

T_BOOL TipcConnTrafficGetMsgsSent8(conn, msgs_sent_return) 
T_IPC_CONN conn; 
T_INT8 *msgs_sent_return; 

The previous functions supersede their older counterparts. Do not use the following older functions; we have retained them only for backward source compatibility.

TipcConnTrafficGetBytesRecv — get the total number of bytes received on a connection

T_BOOL TipcConnTrafficGetBytesRecv(conn, bytes_recv_return) 
T_IPC_CONN conn; 
T_INT4 *bytes_recv_return; 

TipcConnTrafficGetBytesSent — get the total number of bytes sent on a connection

T_BOOL TipcConnTrafficGetBytesSent(conn, bytes_sent_return) 
T_IPC_CONN conn; 
T_INT4 *bytes_sent_return; 

TipcConnTrafficGetMsgsRecv — get the total number of messages received on a connection

T_BOOL TipcConnTrafficGetMsgsRecv(conn, msgs_recv_return) 
T_IPC_CONN conn; 
T_INT4 *msgs_recv_return; 

TipcConnTrafficGetMsgsSent — get the total number of messages sent on a connection

T_BOOL TipcConnTrafficGetMsgsSent(conn, msgs_sent_return) 
T_IPC_CONN conn; 
T_INT4 *msgs_sent_return; 

Property Set Functions (TipcConnSet*)

The TipcConnSet* functions are used to set the properties of a connection. The property of a connection is a piece of information about the connection, such as how often messages are expected to be available for reading.

TipcConnSetAutoFlushSize — set the automatic flush size of a connection

T_BOOL TipcConnSetAutoFlushSize(conn, auto_flush_size) 
T_IPC_CONN conn; 
T_INT4 auto_flush_size; 

TipcConnSetBlockMode — set the block mode of a connection

T_BOOL TipcConnSetBlockMode(conn, block_mode) 
T_IPC_CONN conn; 
T_BOOL block_mode; 

TipcConnSetGmdMaxSize — set a connection’s GMD area maximum size

T_BOOL TipcConnSetGmdMaxSize(conn, gmd_max_size) 
T_IPC_CONN conn; 
T_UINT4 gmd_max_size; 

TipcConnSetSocket — set the socket of a connection

T_BOOL TipcConnSetSocket(conn, socket) 
T_IPC_CONN conn; 
T_INT4 socket; 

TipcConnSetTimeout — set a timeout property of a connection

T_BOOL TipcConnSetTimeout(conn, timeout, value) 
T_IPC_CONN conn; 
T_IPC_TIMEOUT timeout; 
T_REAL8 value; 

Reading and Processing Messages from a Connection

These functions are used to read a message from a connection, search for a message on a connection, and process a message which has been read in from a connection.

TipcConnMainLoop — read and process messages on a connection

T_BOOL TipcConnMainLoop(conn, timeout) 
T_IPC_CONN conn; 
T_REAL8 timeout; 

TipcConnMsgInsert — insert a message into the queue of a connection

T_BOOL TipcConnMsgInsert(conn, msg, pos) 
T_IPC_CONN conn; 
T_IPC_MSG msg; 
T_INT4 pos; 

TipcConnMsgNext — determine the next message from a connection

T_IPC_MSG TipcConnMsgNext(conn, timeout) 
T_IPC_CONN conn; 
T_REAL8 timeout; 

TipcConnMsgProcess — process a message in a connection

T_BOOL TipcConnMsgProcess(conn, msg) 
T_IPC_CONN conn; 
T_IPC_MSG msg; 

TipcConnMsgSearch — search the message queue of a connection for a specific message

T_IPC_MSG TipcConnMsgSearch(conn, timeout, func, arg) 
T_IPC_CONN conn; 
T_REAL8 timeout; 
T_IPC_CONN_MSG_SEARCH_FUNC func; 
T_PTR arg; 

TipcConnMsgSearchType — search the message queue of a connection for a message with a specific type

T_IPC_MSG TipcConnMsgSearchType(conn, timeout, mt) 
T_IPC_CONN conn; 
T_REAL8 timeout; 
T_IPC_MT mt; 

Sending Messages on a Connection

These functions are used to send a message to a connection.

TipcConnFlush — flush buffered outgoing messages to a connection’s socket

T_BOOL TipcConnFlush(conn) 
T_IPC_CONN conn; 

TipcConnMsgSend — send a message through a connection

T_BOOL TipcConnMsgSend(conn, msg) 
T_IPC_CONN conn; 
T_IPC_MSG msg; 

TipcConnMsgSendRpc — make a remote procedure call (RPC) with messages on a connection

T_IPC_MSG TipcConnMsgSendRpc(conn, call_msg, timeout) 
T_IPC_CONN conn; 
T_IPC_MSG call_msg; 
T_REAL8 timeout; 

TipcConnMsgWrite — construct a message and send it through a connection

T_BOOL TipcConnMsgWrite(conn, mt, ...) 
T_IPC_CONN conn; 
T_IPC_MT mt; 

TipcConnMsgWriteVa — construct a message and send it through a connection (va_list version)

T_BOOL TipcConnMsgWriteVa(conn, mt, var_arg_list) 
T_IPC_CONN conn; 
T_IPC_MT mt; 
va_list var_arg_list; 

TIBCO SmartSockets™ API Quick Reference
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com