summaryrefslogtreecommitdiff
path: root/pjlib
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib')
-rw-r--r--pjlib/include/pj/sock.h9
-rw-r--r--pjlib/src/pj/sock_bsd.c5
-rw-r--r--pjlib/src/pj/sock_common.c5
-rw-r--r--pjlib/src/pj/sock_symbian.cpp1
4 files changed, 20 insertions, 0 deletions
diff --git a/pjlib/include/pj/sock.h b/pjlib/include/pj/sock.h
index bdb24f03..cb3993cb 100644
--- a/pjlib/include/pj/sock.h
+++ b/pjlib/include/pj/sock.h
@@ -297,6 +297,9 @@ extern const pj_uint16_t PJ_TCP_NODELAY;
* @see pj_SO_REUSEADDR */
extern const pj_uint16_t PJ_SO_REUSEADDR;
+/** Do not generate SIGPIPE. @see pj_SO_NOSIGPIPE */
+extern const pj_uint16_t PJ_SO_NOSIGPIPE;
+
/** Set the protocol-defined priority for all packets to be sent on socket.
*/
extern const pj_uint16_t PJ_SO_PRIORITY;
@@ -333,6 +336,9 @@ extern const pj_uint16_t PJ_IP_DROP_MEMBERSHIP;
/** Get #PJ_SO_REUSEADDR constant */
PJ_DECL(pj_uint16_t) pj_SO_REUSEADDR(void);
+ /** Get #PJ_SO_NOSIGPIPE constant */
+ PJ_DECL(pj_uint16_t) pj_SO_NOSIGPIPE(void);
+
/** Get #PJ_SO_PRIORITY constant */
PJ_DECL(pj_uint16_t) pj_SO_PRIORITY(void);
@@ -366,6 +372,9 @@ extern const pj_uint16_t PJ_IP_DROP_MEMBERSHIP;
/** Get #PJ_SO_REUSEADDR constant */
# define pj_SO_REUSEADDR() PJ_SO_REUSEADDR
+ /** Get #PJ_SO_NOSIGPIPE constant */
+# define pj_SO_NOSIGPIPE() PJ_SO_NOSIGPIPE
+
/** Get #PJ_SO_PRIORITY constant */
# define pj_SO_PRIORITY() PJ_SO_PRIORITY
diff --git a/pjlib/src/pj/sock_bsd.c b/pjlib/src/pj/sock_bsd.c
index 47e3fd14..4dbdc5c6 100644
--- a/pjlib/src/pj/sock_bsd.c
+++ b/pjlib/src/pj/sock_bsd.c
@@ -135,6 +135,11 @@ const pj_uint16_t PJ_SO_RCVBUF = SO_RCVBUF;
const pj_uint16_t PJ_SO_SNDBUF = SO_SNDBUF;
const pj_uint16_t PJ_TCP_NODELAY= TCP_NODELAY;
const pj_uint16_t PJ_SO_REUSEADDR= SO_REUSEADDR;
+#ifdef SO_NOSIGPIPE
+const pj_uint16_t PJ_SO_NOSIGPIPE = SO_NOSIGPIPE;
+#else
+const pj_uint16_t PJ_SO_NOSIGPIPE = 0xFFFF;
+#endif
#if defined(SO_PRIORITY)
const pj_uint16_t PJ_SO_PRIORITY = SO_PRIORITY;
#else
diff --git a/pjlib/src/pj/sock_common.c b/pjlib/src/pj/sock_common.c
index fa5858fd..564f2036 100644
--- a/pjlib/src/pj/sock_common.c
+++ b/pjlib/src/pj/sock_common.c
@@ -1137,6 +1137,11 @@ PJ_DEF(pj_uint16_t) pj_SO_REUSEADDR(void)
return PJ_SO_REUSEADDR;
}
+PJ_DEF(pj_uint16_t) pj_SO_NOSIGPIPE(void)
+{
+ return PJ_SO_NOSIGPIPE;
+}
+
PJ_DEF(pj_uint16_t) pj_SO_PRIORITY(void)
{
return PJ_SO_PRIORITY;
diff --git a/pjlib/src/pj/sock_symbian.cpp b/pjlib/src/pj/sock_symbian.cpp
index b1697642..10eb1fa6 100644
--- a/pjlib/src/pj/sock_symbian.cpp
+++ b/pjlib/src/pj/sock_symbian.cpp
@@ -53,6 +53,7 @@ const pj_uint16_t PJ_SOL_IP = 0xFFFF;
const pj_uint16_t PJ_SOL_TCP = 0xFFFF;
const pj_uint16_t PJ_SOL_UDP = 0xFFFF;
const pj_uint16_t PJ_SOL_IPV6 = 0xFFFF;
+const pj_uint16_t PJ_SO_NOSIGPIPE = 0xFFFF;
/* TOS */
const pj_uint16_t PJ_IP_TOS = 0;