27 lines
537 B
C

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