Ignore:
Timestamp:
May 19, 2016 6:55:16 AM (5 years ago)
Author:
ming
Message:

Fixed #1921: Add support to handle IPv6 transports in pjsua_transport API and transport keep alive

Also:

  • add more detailed transport info for TCP and TLS transport
  • fixed pjsua sample app which tries to get IPv4 local address from IPv6 transport.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c

    r5244 r5308  
    252252                                        ) 
    253253{ 
     254    enum { INFO_LEN = 100 }; 
     255    char local_addr[PJ_INET6_ADDRSTRLEN+10]; 
    254256    pj_pool_t *pool; 
    255257    pj_sock_t sock = PJ_INVALID_SOCKET; 
     
    474476 
    475477#endif 
     478 
     479    /* Set transport info. */ 
     480    if (listener->factory.info == NULL) { 
     481        listener->factory.info = (char*) pj_pool_alloc(listener->factory.pool, 
     482                                                       INFO_LEN); 
     483    } 
     484    pj_sockaddr_print(listener_addr, local_addr, sizeof(local_addr), 3); 
     485    pj_ansi_snprintf(  
     486        listener->factory.info, INFO_LEN, "tcp %s [published as %.*s:%d]", 
     487        local_addr, 
     488        (int)listener->factory.addr_name.host.slen, 
     489        listener->factory.addr_name.host.ptr, 
     490        listener->factory.addr_name.port); 
    476491 
    477492    if (has_listener) { 
Note: See TracChangeset for help on using the changeset viewer.