__code getDataLocalDGMQueue(struct LocalDGMQueue* cQueue, __code next(...), __code whenEOF(...), __code whenError(...)){ int recv_size, send_size; char send_buf; union Data* recv_data; recv_size = read(tQueue->socket, recv_data, sizeof(union Data)); if (recv_size == -1) { printf("recv error\n"); goto whenError(...); } if (recv_size == 0) { printf("connection ended\n"); goto whenError(...); } FileString* fileString = NEW(FileString); fileString = recv_data; if (fileString->EoF) == 1) { send_buf = 0; send_size = send(cQueue->socket, &send_buf, 1, 0); if (send_size == -1) { printf("send error\n"); } close(cQueue->buffer); goto whenEOF(...); } else { send_buf = 1; send_size = send(cQueue->socket, &send_buf, 1, 0); if (send_size == -1) { printf("send error\n"); goto whenError(...); } } Gearef(context, cQueue)->data = recv_data; goto putLocalDGMQueue(recv_data, next); }