diff options
Diffstat (limited to 'pjlib/src/pj/sock_bsd.c')
-rw-r--r-- | pjlib/src/pj/sock_bsd.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pjlib/src/pj/sock_bsd.c b/pjlib/src/pj/sock_bsd.c index 2551e641..aef2ff8a 100644 --- a/pjlib/src/pj/sock_bsd.c +++ b/pjlib/src/pj/sock_bsd.c @@ -513,12 +513,21 @@ PJ_DEF(pj_status_t) pj_sock_socket(int af, PJ_ASSERT_RETURN(sock!=NULL, PJ_EINVAL); PJ_ASSERT_RETURN(PJ_INVALID_SOCKET==-1, (*sock=PJ_INVALID_SOCKET, PJ_EINVAL)); - + *sock = socket(af, type, proto); if (*sock == PJ_INVALID_SOCKET) return PJ_RETURN_OS_ERROR(pj_get_native_netos_error()); - else + else { +#if defined(PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT) && \ + PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT!=0 + pj_int32_t val = 1; + if (type == pj_SOCK_DGRAM()) { + pj_sock_setsockopt(*sock, pj_SOL_SOCKET(), SO_NOSIGPIPE, + &val, sizeof(val)); + } +#endif return PJ_SUCCESS; + } } #endif |