Commit 34ad384c authored by Roshan Rabinarayan's avatar Roshan Rabinarayan

aaaa

parent 3a2059c9
...@@ -106,12 +106,13 @@ void *worker(void *args) { ...@@ -106,12 +106,13 @@ void *worker(void *args) {
fflush(stdout); fflush(stdout);
read(read_pipe, newfd, sizeof(newfd)); read(read_pipe, newfd, sizeof(newfd));
printf("\nread %d", *newfd); printf("\nread %d", *newfd);
if (epoll_ctl(epollfd, EPOLL_CTL_ADD, newfd, ) == -1) { if (epoll_ctl(epollfd, EPOLL_CTL_ADD, *newfd, &ev) == -1) {
perror("epoll_ctl: read_pipe"); perror("epoll_ctl: read_pipe");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
fflush(stdout); fflush(stdout);
} else { }
else{
struct message *requestMessage= malloc(sizeof(struct message)); struct message *requestMessage= malloc(sizeof(struct message));
read( events[i].data.fd , requestMessage, sizeof(struct message)); read( events[i].data.fd , requestMessage, sizeof(struct message));
printf("[Message Received from client]\n[[Status:%c]\n[Key:%s]\n[Value:%s]]",requestMessage->status,requestMessage->key,requestMessage->value); printf("[Message Received from client]\n[[Status:%c]\n[Key:%s]\n[Value:%s]]",requestMessage->status,requestMessage->key,requestMessage->value);
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment