TipcSrvMsgWriteVa construct a message and send it through the connection to RTserver (va_list
version)
T_BOOL TipcSrvMsgWriteVa(dest
,mt
,check_server_msg_send
,var_arg_list
) T_STRdest
; T_IPC_MTmt
; T_BOOLcheck_server_msg_send
; va_listvar_arg_list
;
dest
message destination
mt
message type
check_server_msg_send
whether or not to check the option Server_Msg_Send first
var_arg_list
argument list
TRUE
if the message was successfully constructed and sent, FALSE
otherwise.
If TipcSrvMsgWriteVa fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcSrvMsgWriteVa is the non-varargs
version of TipcSrvMsgWrite (TipcSrvMsgWrite actually calls TipcSrvMsgWriteVa). TipcSrvMsgWriteVa can be used to implement a varargs
function.
In the C language, a varargs
function (one that takes a variable number of arguments) cannot call another varargs
function with the original arguments. A varargs
function usually calls a helper function that takes a fixed number of arguments, with the last argument usually of type va_list
. TipcSrvMsgWriteVa is TipcSrvMsgWrite’s helper function.
None
TipcSrvMsgWrite, TipcMsgWriteVa, TipcSrvMsgSend
This example shows how to write a varargs
function in ANSI C that is similar to TipcSrvMsgWrite, but always checks the option Server_Msg_Send:
T_BOOL T_ENTRY my_srv_msg_write(T_STR dest,
T_IPC_MT mt,
...)
{
va_list var_arg_list;
T_BOOL status;
va_start(var_arg_list, mt);
status = TipcSrvMsgWriteVa(dest, mt, TRUE, var_arg_list);
va_end(var_arg_list);
return status;
} /* my_srv_msg_write */
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |