TipcSrvConnMsgWrite construct a message and send it through the connection
T_BOOL TipcSrvConnMsgWrite(srv
,dest
,mt
,check_server_msg_send
, ...) T_IPC_SRVsrv
; T_STRdest
; T_IPC_MTmt
; T_BOOLcheck_server_msg_send
;
srv
connection handle to RTserver
dest
destination subject for message
mt
message type to use for message
check_server_msg_send
whether or not to check the option Server_Msg_Send first
additional arguments null-terminated field type-value pairs
TRUE
if the message was successfully constructed and sent, FALSE
otherwise.
If TipcSrvConnMsgWrite fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcSrvConnMsgWrite is a convenience function that takes a null-terminated variable number of field type-value pairs. The field type part of the pair is T_IPC_FT
, and the value part of the pair corresponds to the arguments for the related TipcMsgAppend* function (if the type part is T_IPC_FT_REAL8
, then the value part is a REAL8 number) or TipcMsgSet* function (if the type part is T_IPC_PROP_DELIVERY_MODE
, then the value part is a T_IPC_DELIVERY_MODE
setting). Some field types, such as arrays, use two arguments for the value part.
TipcSrvConnMsgWrite performs these steps:
TipcSrvConnMsgWrite is a short wrapper function that calls TipcSrvConnMsgWriteVa.
If check_server_msg_send
is TRUE
and the option Server_Msg_Send is FALSE
, then TipcSrvConnMsgWrite does not send the message, but returns TRUE
immediately. For normal usage, check_server_msg_send
should always be TRUE
. This allows the user to globally turn off all normal outgoing messages by setting the option Server_Msg_Send to FALSE
. This is useful for running two RTclients, the primary one with Server_Msg_Send set to TRUE
and the backup one with Server_Msg_Send set to FALSE
.
TipcSrvConnMsgWrite may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, TipcSrvConnMsgWrite buffers the message as if the RTclient were still connected to RTserver. See TipcSrvConnCreate for more information on automatic creation of connections and warm connections to RTserver.
None
TipcConnMsgWrite, TipcSrvConnMsgSend, TipcSrvConnMsgWriteVa
This example constructs and sends a NUMERIC_DATA message with TipcSrvConnMsgWrite:
T_IPC_MT mt; mt = TipcMtLookupByNum(T_MT_NUMERIC_DATA); if (mt == NULL) {return
; /* error */
} if (!TipcSrvConnMsgWrite(srv, "/primary/control", mt, TRUE, T_IPC_FT_STR, "voltage1", T_IPC_FT_REAL8, 65.0, T_IPC_FT_STR, "current1", T_IPC_FT_REAL8, 10.335, NULL)) {return
; /* error */
}
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |