- Timestamp:
- Apr 26, 2013 6:01:43 AM (12 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/ssl_sock.h
r4146 r4506 712 712 713 713 /** 714 * Specify if SO_REUSEADDR should be used for listening socket. This 715 * option will only be used with accept() operation. 716 * 717 * Default is PJ_FALSE. 718 */ 719 pj_bool_t reuse_addr; 720 721 /** 714 722 * QoS traffic type to be set on this transport. When application wants 715 723 * to apply QoS tagging to the transport, it's preferable to set this -
pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
r4466 r4506 2378 2378 goto on_error; 2379 2379 2380 /* Apply SO_REUSEADDR */ 2381 if (ssock->param.reuse_addr) { 2382 int enabled = 1; 2383 status = pj_sock_setsockopt(ssock->sock, pj_SOL_SOCKET(), 2384 pj_SO_REUSEADDR(), 2385 &enabled, sizeof(enabled)); 2386 if (status != PJ_SUCCESS) { 2387 PJ_PERROR(4,(ssock->pool->obj_name, status, 2388 "Warning: error applying SO_REUSEADDR")); 2389 } 2390 } 2391 2380 2392 /* Apply QoS, if specified */ 2381 2393 status = pj_sock_apply_qos2(ssock->sock, ssock->param.qos_type, -
pjproject/trunk/pjsip/include/pjsip/sip_config.h
r4442 r4506 570 570 571 571 /** 572 * Specify whether TCP listener should use SO_REUSEADDR option. This constant 573 * will be used as the default value for the "reuse_addr" field in the 574 * pjsip_tcp_transport_cfg structure. 575 * 576 * Default is FALSE on Windows and TRUE on non-Windows. 577 * 578 * @see PJSIP_TLS_TRANSPORT_REUSEADDR 579 */ 580 #ifndef PJSIP_TCP_TRANSPORT_REUSEADDR 581 # if defined(PJ_WIN32) && PJ_WIN32 582 # define PJSIP_TCP_TRANSPORT_REUSEADDR 0 583 # else 584 # define PJSIP_TCP_TRANSPORT_REUSEADDR 1 585 # endif 586 #endif 587 588 589 /** 572 590 * Set the interval to send keep-alive packet for TCP transports. 573 591 * If the value is zero, keep-alive will be disabled for TCP. … … 676 694 #endif 677 695 696 697 /** 698 * Specify whether TLS listener should use SO_REUSEADDR option. 699 * 700 * Default is FALSE on Windows and TRUE on non-Windows. 701 * 702 * @see PJSIP_TCP_TRANSPORT_REUSEADDR 703 */ 704 #ifndef PJSIP_TLS_TRANSPORT_REUSEADDR 705 # if defined(PJ_WIN32) && PJ_WIN32 706 # define PJSIP_TLS_TRANSPORT_REUSEADDR 0 707 # else 708 # define PJSIP_TLS_TRANSPORT_REUSEADDR 1 709 # endif 710 #endif 678 711 679 712 -
pjproject/trunk/pjsip/include/pjsip/sip_transport_tcp.h
r3553 r4506 63 63 */ 64 64 pj_sockaddr bind_addr; 65 66 /** 67 * Should SO_REUSEADDR be used for the listener socket. 68 * Default value is PJSIP_TCP_TRANSPORT_REUSEADDR. 69 */ 70 pj_bool_t reuse_addr; 65 71 66 72 /** -
pjproject/trunk/pjsip/include/pjsip/sip_transport_tls.h
r4262 r4506 175 175 176 176 /** 177 * Should SO_REUSEADDR be used for the listener socket. 178 * Default value is PJSIP_TLS_TRANSPORT_REUSEADDR. 179 */ 180 pj_bool_t reuse_addr; 181 182 /** 177 183 * QoS traffic type to be set on this transport. When application wants 178 184 * to apply QoS tagging to the transport, it's preferable to set this … … 226 232 { 227 233 pj_memset(tls_opt, 0, sizeof(*tls_opt)); 234 tls_opt->reuse_addr = PJSIP_TLS_TRANSPORT_REUSEADDR; 228 235 tls_opt->qos_type = PJ_QOS_TYPE_BEST_EFFORT; 229 236 tls_opt->qos_ignore_error = PJ_TRUE; -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
r4451 r4506 218 218 pj_sockaddr_init(cfg->af, &cfg->bind_addr, NULL, 0); 219 219 cfg->async_cnt = 1; 220 cfg->reuse_addr = PJSIP_TCP_TRANSPORT_REUSEADDR; 220 221 } 221 222 … … 298 299 2, listener->factory.obj_name, 299 300 "SIP TCP listener socket"); 301 302 /* Apply SO_REUSEADDR */ 303 if (cfg->reuse_addr) { 304 int enabled = 1; 305 status = pj_sock_setsockopt(sock, pj_SOL_SOCKET(), pj_SO_REUSEADDR(), 306 &enabled, sizeof(enabled)); 307 if (status != PJ_SUCCESS) { 308 PJ_PERROR(4,(listener->factory.obj_name, status, 309 "Warning: error applying SO_REUSEADDR")); 310 } 311 } 300 312 301 313 /* Bind address may be different than factory.local_addr because -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c
r4450 r4506 338 338 ssock_param.ciphers_num = listener->tls_setting.ciphers_num; 339 339 ssock_param.ciphers = listener->tls_setting.ciphers; 340 ssock_param.reuse_addr = listener->tls_setting.reuse_addr; 340 341 ssock_param.qos_type = listener->tls_setting.qos_type; 341 342 ssock_param.qos_ignore_error = listener->tls_setting.qos_ignore_error;
Note: See TracChangeset
for help on using the changeset viewer.