Nog een poging...
This commit is contained in:
parent
afa3a46a9b
commit
8b7781fcfb
1 changed files with 3 additions and 8 deletions
|
@ -30,7 +30,6 @@ int main(){
|
||||||
while (server_socket > 0){
|
while (server_socket > 0){
|
||||||
waitpid((pid_t)-1, &status, WNOHANG);
|
waitpid((pid_t)-1, &status, WNOHANG);
|
||||||
CONN_fd = DDV_Accept(server_socket);
|
CONN_fd = DDV_Accept(server_socket);
|
||||||
CONN = fdopen(CONN_fd, "r+");
|
|
||||||
pid_t myid = fork();
|
pid_t myid = fork();
|
||||||
if (myid == 0){
|
if (myid == 0){
|
||||||
break;
|
break;
|
||||||
|
@ -42,6 +41,7 @@ int main(){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CONN = fdopen(CONN_fd, "r+");
|
||||||
|
|
||||||
|
|
||||||
unsigned int ts;
|
unsigned int ts;
|
||||||
|
@ -51,8 +51,6 @@ int main(){
|
||||||
|
|
||||||
//first timestamp set
|
//first timestamp set
|
||||||
firsttime = getNowMS();
|
firsttime = getNowMS();
|
||||||
int now = getNowMS();
|
|
||||||
int lastcheck = now;
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "Doing handshake...\n");
|
fprintf(stderr, "Doing handshake...\n");
|
||||||
|
@ -86,12 +84,9 @@ int main(){
|
||||||
while (!ferror(CONN) && !feof(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, 100);
|
retval = epoll_wait(poller, events, 1, 0);
|
||||||
now = getNowMS();
|
if ((retval > 0) || (!ready4data || (snd_cnt - snd_window_at >= snd_window_size))){
|
||||||
if ((retval > 0) || ((now - lastcheck > 1) && (!ready4data || (snd_cnt - snd_window_at >= snd_window_size)))){
|
|
||||||
lastcheck = now;
|
|
||||||
parseChunk();
|
parseChunk();
|
||||||
fflush(CONN);
|
|
||||||
}
|
}
|
||||||
if (ready4data){
|
if (ready4data){
|
||||||
if (!inited){
|
if (!inited){
|
||||||
|
|
Loading…
Add table
Reference in a new issue