Changeset 260
- Timestamp:
- Mar 1, 2006 11:05:11 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
r252 r260 20 20 #include <pjsip/sip_endpoint.h> 21 21 #include <pjsip/sip_errno.h> 22 #include <pj/addr_resolv.h> 23 #include <pj/assert.h> 24 #include <pj/lock.h> 25 #include <pj/log.h> 26 #include <pj/os.h> 22 27 #include <pj/pool.h> 23 28 #include <pj/sock.h> 24 #include <pj/addr_resolv.h>25 #include <pj/os.h>26 #include <pj/lock.h>27 29 #include <pj/string.h> 28 #include <pj/assert.h> 30 31 32 #define THIS_FILE "sip_transport_udp.c" 33 34 /** 35 * These are the values for socket send and receive buffer sizes, 36 * respectively. They will be applied to UDP socket with setsockopt(). 37 */ 38 #ifndef PJSIP_UDP_SO_SNDBUF_SIZE 39 # define PJSIP_UDP_SO_SNDBUF_SIZE (4*1024*1024) 40 #endif 41 42 #ifndef PJSIP_UDP_SO_RCVBUF_SIZE 43 # define PJSIP_UDP_SO_RCVBUF_SIZE (4*1024*1024) 44 #endif 29 45 30 46 … … 330 346 pj_ioqueue_t *ioqueue; 331 347 pj_ioqueue_callback ioqueue_cb; 348 long sobuf_size; 332 349 unsigned i; 333 350 pj_status_t status; … … 335 352 PJ_ASSERT_RETURN(endpt && sock!=PJ_INVALID_SOCKET && a_name && async_cnt>0, 336 353 PJ_EINVAL); 354 355 356 /* Adjust socket rcvbuf size */ 357 sobuf_size = PJSIP_UDP_SO_RCVBUF_SIZE; 358 status = pj_sock_setsockopt(sock, PJ_SOL_SOCKET, PJ_SO_RCVBUF, 359 &sobuf_size, sizeof(sobuf_size)); 360 if (status != PJ_SUCCESS) { 361 char errmsg[PJ_ERR_MSG_SIZE]; 362 pj_strerror(status, errmsg, sizeof(errmsg)); 363 PJ_LOG(4,(THIS_FILE, "Error setting SO_RCVBUF: %s [%d]", errmsg, 364 status)); 365 } 366 367 /* Adjust socket sndbuf size */ 368 sobuf_size = PJSIP_UDP_SO_SNDBUF_SIZE; 369 status = pj_sock_setsockopt(sock, PJ_SOL_SOCKET, PJ_SO_SNDBUF, 370 &sobuf_size, sizeof(sobuf_size)); 371 if (status != PJ_SUCCESS) { 372 char errmsg[PJ_ERR_MSG_SIZE]; 373 pj_strerror(status, errmsg, sizeof(errmsg)); 374 PJ_LOG(4,(THIS_FILE, "Error setting SO_SNDBUF: %s [%d]", errmsg, 375 status)); 376 } 337 377 338 378 /* Create pool. */
Note: See TracChangeset
for help on using the changeset viewer.