TipcConnMsgWriteVa


Name

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

Synopsis

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

Arguments

conn — connection to send message through

mt — message type

var_arg_list — argument list

Return Values

TRUE if the message was successfully constructed and sent, FALSE otherwise.

Diagnostics

If TipcConnMsgWriteVa fails, it returns FALSE and sets the global SmartSockets error number to one of:

Description

TipcConnMsgWriteVa is the non-varargs version of TipcConnMsgWrite (TipcConnMsgWrite actually calls TipcConnMsgWriteVa). TipcConnMsgWriteVa 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. TipcConnMsgWriteVa is TipcConnMsgWrite’s helper function.

Caution

None

See Also

TipcConnMsgWrite, TipcConnMsgWriteVa

Examples

This example shows how to write a varargs function in ANSI C that constructs a message and sends it on a predefined connection:

extern T_IPC_CONN my_conn; 
 
T_BOOL my_conn_msg_write(T_IPC_MT mt, 
                         ...) 
{ 
  va_list var_arg_list; 
  T_BOOL status; 
 
  va_start(var_arg_list, mt); 
  status = TipcConnMsgWriteVa(my_conn, mt, var_arg_list); 
  va_end(var_arg_list); 
  return status; 
} /* my_conn_msg_write */ 

TIBCO SmartSockets™ Application Programming Interface
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com