Mercurial > hg > Papers > 2022 > ikki-master
view Paper/src/RemoteDGMQueue.cbc @ 12:2c54886cebef
add evaluation
author | ichikitakahiro <e165713@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 30 Jan 2022 04:52:30 +0900 |
parents | 25cf5b9b74a2 |
children | 01b88c0dd337 |
line wrap: on
line source
__code sendDataRemoteDGMQueue(struct RemoteDGMQueue* cQueue, union Data* data, __code next(...), __code whenError(...)){ char recv_buf; int send_size, recv_size; send_size = send(cQueue->socket, data, sizeof(union Data), 0); if (send_size == -1) { printf("send error\n"); close(cQueue->socket); goto whenError(); } recv_size = recv(cQueue->socket, &recv_buf, 1, 0); if (recv_size == -1) { printf("recv error\n"); close(cQueue->socket); goto whenError(); } else if (recv_size == 0) { printf("connection ended\n"); close(cQueue->socket); goto whenError(); } else if(recv_buf == 0) { printf("Finish connection\n"); close(cQueue->socket); goto whenError(); } goto next(...); }