diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-12-25 06:39:33 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-12-25 06:39:33 +0000 |
commit | 94aaa0ce2af8bf9799752bb6cb6c9989d60bc612 (patch) | |
tree | 8855c387f04f1a1b8c6eb26b8e141536e2d6d563 /pjlib | |
parent | 62775e81863b45f7f8c896e7e8623ad783e8b6f3 (diff) |
In relation to ticket #49: fix support for recv() flags such as PJ_MSG_PEEK and PJ_MSG_OOB etc
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@860 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/include/pj/sock.h | 11 | ||||
-rw-r--r-- | pjlib/src/pj/sock_bsd.c | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/pjlib/include/pj/sock.h b/pjlib/include/pj/sock.h index a6e760aa..7321c5de 100644 --- a/pjlib/include/pj/sock.h +++ b/pjlib/include/pj/sock.h @@ -102,15 +102,12 @@ extern const pj_uint16_t PJ_SO_RCVBUF; /**< Buffer size for receive. */ extern const pj_uint16_t PJ_SO_SNDBUF; /**< Buffer size for send. */ -/** +/* * Flags to be specified in #pj_sock_recv, #pj_sock_send, etc. */ -typedef enum pj_sock_msg_flag -{ - PJ_MSG_OOB = 0x01, /**< Out-of-band messages. */ - PJ_MSG_PEEK = 0x02, /**< Peek, don't remove from buffer. */ - PJ_MSG_DONTROUTE = 0x04 /**< Don't route. */ -} pj_sock_msg_flag; +extern const int PJ_MSG_OOB; /**< Out-of-band messages. */ +extern const int PJ_MSG_PEEK; /**< Peek, don't remove from buffer. */ +extern const int PJ_MSG_DONTROUTE; /**< Don't route. */ /** diff --git a/pjlib/src/pj/sock_bsd.c b/pjlib/src/pj/sock_bsd.c index 49fe0232..61745308 100644 --- a/pjlib/src/pj/sock_bsd.c +++ b/pjlib/src/pj/sock_bsd.c @@ -82,6 +82,12 @@ const pj_uint16_t PJ_SO_RCVBUF = SO_RCVBUF; const pj_uint16_t PJ_SO_SNDBUF = SO_SNDBUF; +/* recv() and send() flags */ +const int PJ_MSG_OOB = MSG_OOB; +const int PJ_MSG_PEEK = MSG_PEEK; +const int PJ_MSG_DONTROUTE = MSG_DONTROUTE; + + #if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 # define SET_LEN(addr,len) (((pj_sockaddr*)(addr))->sa_zero_len=(len)) # define RESET_LEN(addr) (((pj_sockaddr*)(addr))->sa_zero_len=0) |