From 1229122bc17bb86b6a10e043aa3505715b797347 Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Wed, 19 Jun 2013 09:06:55 +0000 Subject: 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 --- pjlib/include/pj/sock.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'pjlib/include') 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 @@ -1306,6 +1306,27 @@ PJ_DECL(pj_status_t) pj_sock_setsockopt( pj_sock_t sockfd, int optlen); +/** + * 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. * -- cgit v1.2.3