Changeset 3896
- Timestamp:
- Dec 5, 2011 2:12:38 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.x/pjlib-util/src/pjlib-util/stun_simple_client.c
r3553 r3896 20 20 #include <pjlib-util/stun_simple.h> 21 21 #include <pjlib-util/errno.h> 22 #include <pj/compat/socket.h> 22 23 #include <pj/log.h> 23 24 #include <pj/os.h> … … 45 46 unsigned srv_cnt; 46 47 pj_sockaddr_in srv_addr[2]; 47 int i, j, send_cnt = 0 ;48 int i, j, send_cnt = 0, nfds; 48 49 pj_pool_t *pool; 49 50 struct query_rec { … … 114 115 TRACE_((THIS_FILE, " Done initialization.")); 115 116 117 #if defined(PJ_SELECT_NEEDS_NFDS) && PJ_SELECT_NEEDS_NFDS!=0 118 nfds = -1; 119 for (i=0; i<sock_cnt; ++i) { 120 if (sock[i] > nfds) { 121 nfds = sock[i]; 122 } 123 } 124 #else 125 nfds = FD_SETSIZE-1; 126 #endif 127 116 128 /* Main retransmission loop. */ 117 129 for (send_cnt=0; send_cnt<MAX_REQUEST; ++send_cnt) { … … 170 182 } 171 183 172 select_rc = pj_sock_select( PJ_IOQUEUE_MAX_HANDLES, &r, NULL, NULL, &timeout);184 select_rc = pj_sock_select(nfds+1, &r, NULL, NULL, &timeout); 173 185 TRACE_((THIS_FILE, " select() rc=%d", select_rc)); 174 186 if (select_rc < 1)
Note: See TracChangeset
for help on using the changeset viewer.