Nog een poging...
This commit is contained in:
parent
4a6de43ed7
commit
4ad85c9aac
1 changed files with 55 additions and 52 deletions
|
@ -79,15 +79,16 @@ int main(){
|
|||
|
||||
|
||||
|
||||
while (!ferror(CONN)){
|
||||
while (!ferror(CONN) && !feof(CONN)){
|
||||
//only parse input if available or not yet init'ed
|
||||
//rightnow = getNowMS();
|
||||
retval = epoll_wait(poller, events, 1, 1000);
|
||||
if (retval){
|
||||
fprintf(stderr, "Socket %i is now state %i, in is %i, out is %i\n", events[0].data.fd, events[0].events, EPOLLIN, EPOLLOUT);
|
||||
if (events[0].events & EPOLLIN){
|
||||
parseChunk();
|
||||
fflush(CONN);
|
||||
}
|
||||
if (events[0].events & EPOLLOUT){
|
||||
if (ready4data){
|
||||
if (!inited){
|
||||
//we are ready, connect the socket!
|
||||
|
@ -142,6 +143,8 @@ int main(){
|
|||
SendCTL(3, rec_cnt);//send ack (msg 3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "User disconnected.\n");
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue