diff options
| author | Anton <anton@picapica> | 2016-10-26 19:57:36 +0400 |
|---|---|---|
| committer | Anton <anton@picapica> | 2016-10-26 19:57:36 +0400 |
| commit | 4e4ec4e69c201565e3c1e87a520650ab490924c0 (patch) | |
| tree | 4c0e402dd3bfaae33a0c0a00a95ef75820007184 | |
| parent | abbfa4ccdcfc8633e5b30064f66af40b6b17cbd6 (diff) | |
| download | pica-pica-4e4ec4e69c201565e3c1e87a520650ab490924c0.tar.gz pica-pica-4e4ec4e69c201565e3c1e87a520650ab490924c0.zip | |
add listener connections' sockets to fd_set-s in event loop
| -rw-r--r-- | PICA_client.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/PICA_client.c b/PICA_client.c index 85469c9..9374f35 100644 --- a/PICA_client.c +++ b/PICA_client.c @@ -2017,6 +2017,7 @@ int PICA_event_loop(struct PICA_c2n **connections, int timeout) while(ic2n && *ic2n) { struct PICA_c2c *ic2c; + struct PICA_listener_conn *ilstcon; //printf("event_loop: adding c2n %p\n", *ic2n);//debug @@ -2028,6 +2029,15 @@ int PICA_event_loop(struct PICA_c2n **connections, int timeout) fdset_add(&rfds, (*ic2n)->directc2c_listener->sck_listener, &nfds); + ilstcon = (*ic2n)->directc2c_listener->accepted_connections; + + while (ilstcon) + { + fdset_add(&rfds, ilstcon->sck, &nfds); + fdset_add(&wfds, ilstcon->sck, &nfds); + ilstcon = ilstcon->next; + } + ic2c = (*ic2n)->chan_list_head; while(ic2c) |
