diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2013-06-19 09:06:55 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2013-06-19 09:06:55 +0000 |
commit | 1229122bc17bb86b6a10e043aa3505715b797347 (patch) | |
tree | ae8a72fe1f020f77c31514b05fbd98af2fdcd434 /pjlib/include/pj/sock.h | |
parent | d7aa4332dae06ae890053dd13239ddabee46b86c (diff) |
Close #1681:
- Added compile-time settings PJMEDIA_TRANSPORT_SO_RCVBUF_SIZE and PJMEDIA_TRANSPORT_SO_SNDBUF_SIZE. The default values are both 64 KB when PJMEDIA_HAS_VIDEO is set, otherwise just zero (socket buffer size uses OS default). The settings will be applied to media transport UDP and ICE.
- Also added run-time settings so_sndbuf_size and so_rcvbuf_size into ICE stream transport, STUN socket, and TURN socket. Default values are all zero.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4538 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include/pj/sock.h')
-rw-r--r-- | pjlib/include/pj/sock.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pjlib/include/pj/sock.h b/pjlib/include/pj/sock.h index 4011f21a..b7d1cb05 100644 --- a/pjlib/include/pj/sock.h +++ b/pjlib/include/pj/sock.h @@ -1307,6 +1307,27 @@ PJ_DECL(pj_status_t) pj_sock_setsockopt( pj_sock_t sockfd, /** + * Helper function to set socket buffer size using #pj_sock_setsockopt() + * with capability to auto retry with lower buffer setting value until + * the highest possible value is successfully set. + * + * @param sockfd The socket descriptor. + * @param optname The option name, valid values are pj_SO_RCVBUF() + * and pj_SO_SNDBUF(). + * @param auto_retry Option whether auto retry with lower value is + * enabled. + * @param buf_size On input, specify the prefered buffer size setting, + * on output, the buffer size setting applied. + * + * @return PJ_SUCCESS or the status code. + */ +PJ_DECL(pj_status_t) pj_sock_setsockopt_sobuf( pj_sock_t sockfd, + pj_uint16_t optname, + pj_bool_t auto_retry, + unsigned *buf_size); + + +/** * Receives data stream or message coming to the specified socket. * * @param sockfd The socket descriptor. |