#include
"ucm.h"
main(argc, argv)int argc;
char *argv[];
{
int version;
/* client version */
T_SOCKET sock; /*
socket from argv[1] */
ucmProgName = argv[0]; /* for UCM error msgs */
sock = atoi(argv[1]);
version= UcmClientVersion(sock, 10000);
UcmInit();
if (UcmOpen(sock))
Error("UcmOpen failed, error=%d",
ucmErrno);
if (version >= 200)
UcmCntl(sock, UC_KEEPALIVE, 120, 10);
while ((len = UcmRecv(sock, msgId, msg,
-1, UF_NOFLAGS)) > 0)
{
/* process incoming message */
if (strcmp(msg, "Exit") == 0)
break;
UcmSendf(sock, msgId, "Got: %s",
msg);
}
UcmClose(sock);
UcmTerm();
return 0;
/*
terminate program */
} |