|
|
Synopsis Environment
Description Diagnostics
See also Examples |
Synopsis |
#include "ucm.h" int
UcmSend(sock, msgId, msg, msgLen, flag);
T_SOCKET sock;
char *msgId, *msg;
int msgLen, flag; |
Environment |
Unix, Win32
|
Description |
UcmSend sends msgLen bytes of the data in the
buffer pointed to by msg through the socket sock. If zero-terminated strings
have to be sent, msgLen may be specified as -1. This causes UcmSend to
transfer strlen(msg) + 1 bytes (by including the string terminator, the receiving
program may safely use sscanf to extract fields from the message). One or more
(bitwise inclusive OR-operation) of the following modes may be selected in the parameter flag:
| UF_NOFLAGS |
No special processing / normal case. |
Note: At this time, no other flags are available. This parameter is reserved for
future use.
UcmSend will fail if one or more of the following is true:
| UE_NOTINIT |
The UCM software has not been initialize (see UcmInit) |
| UE_BADSOCK |
The value of sock is not a valid socket descriptor or the socket is
not open. |
| UE_INTR |
The send process has been interrupted by a signal. |
| UE_CONNECT |
The socket has been closed. |
|
Diagnostics |
Upon successful completion UcmSend returns
UCM_SUCCESS. Otherwise, UCM_ERROR is returned and ucmErrno is set to indicate the
error.
|
See also |
UcmInit, UcmRecv, UcmSendf
|
Examples |
#include
"ucm.h"
T_SOCKET socket;
T_UCM_MSG msg; /* message buffer */
T_UCM_MSGID msgId; /* message ID buffer */
...
rc = UcmSend(socket, msgId, msg, -1, UF_NOFLAGS);
printf("UcmSend returned %d\n", rc); |
|
|
|