25 lines
519 B
C

#include <stdio.h>
#include <stdlib.h>
#include "ZMQLayout.h"
int main()
{
int rv = 0;
pZMQ_s psZMQ = ZMQClientInit("tcp://localhost:60006");
if(!psZMQ) { printf("ZMQServerInit Fail\n"); return -1; }
while (1)
{
rv = ZMQSend(psZMQ, "Client request", 13);
if(rv) { printf("ZMQSend Fail\n"); break; }
pZMQBuf_s psZMQBuf = ZMQRecv(psZMQ, 1);
if(!psZMQBuf) { printf("ZMQRecv Fail\n"); break; }
printf("Read = %s\n", psZMQBuf->pcBuf);
}
return rv;
}