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
|
//only parse input if available or not yet init'ed
|
||||||
//rightnow = getNowMS();
|
//rightnow = getNowMS();
|
||||||
retval = epoll_wait(poller, events, 1, 1000);
|
retval = epoll_wait(poller, events, 1, 1000);
|
||||||
if (retval){
|
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();
|
parseChunk();
|
||||||
fflush(CONN);
|
fflush(CONN);
|
||||||
}
|
}
|
||||||
|
if (events[0].events & EPOLLOUT){
|
||||||
if (ready4data){
|
if (ready4data){
|
||||||
if (!inited){
|
if (!inited){
|
||||||
//we are ready, connect the socket!
|
//we are ready, connect the socket!
|
||||||
|
@ -142,6 +143,8 @@ int main(){
|
||||||
SendCTL(3, rec_cnt);//send ack (msg 3)
|
SendCTL(3, rec_cnt);//send ack (msg 3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "User disconnected.\n");
|
fprintf(stderr, "User disconnected.\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue