Ignore:
Timestamp:
Jul 18, 2016 11:02:02 AM (8 years ago)
Author:
nanang
Message:

Misc (re #1928): Fixed possible stuck issue in pjnath-test caused by blocking recvfrom() upon concurrent socket events.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath-test/test.c

    r4728 r5388  
    2020#include "test.h" 
    2121#include <pjlib.h> 
     22#include <pj/compat/socket.h> 
    2223 
    2324void app_perror(const char *msg, pj_status_t rc) 
     
    2930    pj_strerror(rc, errbuf, sizeof(errbuf)); 
    3031    PJ_LOG(1,("test", "%s: [pj_status_t=%d] %s", msg, rc, errbuf)); 
     32} 
     33 
     34/* Set socket to nonblocking. */ 
     35void app_set_sock_nb(pj_sock_t sock) 
     36{ 
     37#if defined(PJ_WIN32) && PJ_WIN32!=0 || \ 
     38    defined(PJ_WIN64) && PJ_WIN64 != 0 || \ 
     39    defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0 
     40    u_long value = 1; 
     41    ioctlsocket(sock, FIONBIO, &value); 
     42#else 
     43    pj_uint32_t value = 1; 
     44    ioctl(sock, FIONBIO, &value); 
     45#endif 
    3146} 
    3247 
Note: See TracChangeset for help on using the changeset viewer.