TipcConnMsgInsert insert a message into queue of a connection
conn
connection to insert message into
msg
message to insert
pos
position to insert message
TRUE
if the message was successfully inserted into the queue of the connection, FALSE
otherwise.
If TipcConnMsgInsert fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcConnMsgInsert inserts a message into the message queue of a connection. A connection has a priority queue of incoming messages. Use 0
for pos
to insert the message as the first message in the queue, 1
for pos
to insert the message as the second message, and so on. Use T_IPC_POS_PRIORITY for pos
to insert the message in priority order, after all other message with equal or higher priority. TipcConnMsgInsert also calls the connection’s queue callbacks.
The message passed to TipcConnMsgInsert should not be destroyed by calling TipcMsgDestroy, as TipcConnMsgInsert takes responsibility for destroying the message.
TipcConnMsgInsert does not make a copy of msg
.
This example constructs a message and inserts it onto the front of a connection’s message queue:
T_IPC_MT mt; T_IPC_MSG msg; mt = TipcMtLookupByNum(T_MT_NUMERIC_DATA); if (mt == NULL) {return
; /* error */
} msg = TipcMsgCreate(mt); if (msg == NULL) {
return
; /* error */
} if (!TipcMsgAppendStrReal8(msg, "temperature", 98.6)) {
return
; /* error */
} if (!TipcConnMsgInsert(conn, msg, 0)) {
return
; /* error */
}/* At this point, msg "belongs" to the connection, and should */
/* not be destroyed by the caller */
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |