diff options
Diffstat (limited to 'pjlib/include/pj')
-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. |