Changes between Version 15 and Version 16 of IPAddressChange


Ignore:
Timestamp:
Mar 24, 2017 2:56:23 AM (2 years ago)
Author:
ming
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IPAddressChange

    v15 v16  
    231231 4. And finally, once unregistration in 2b) above is complete, re-register (with TCP).  
    232232 
     233== Disconnection detection == 
     234For TCP/TLS, you can enable socket keep-alive parameters via {{{pjsua_transport_config.sockopt_params}}} to detect if there is a disconnection. The below code has been reported to work on iOS (30s timeout). 
     235{{{ 
     236static int time=30, probe=5, interval=1, enable=1; 
     237cfg.sockopt_params.cnt = 4; 
     238cfg.sockopt_params.options[0].level     = pj_SOL_TCP(); 
     239cfg.sockopt_params.options[0].optname   = TCP_KEEPIDLE; 
     240cfg.sockopt_params.options[0].optval    = &time; 
     241cfg.sockopt_params.options[0].optlen    = sizeof(time); 
     242 
     243cfg.sockopt_params.options[1].level     = pj_SOL_TCP(); 
     244cfg.sockopt_params.options[1].optname   = TCP_KEEPINTVL; 
     245cfg.sockopt_params.options[1].optval    = &interval; 
     246cfg.sockopt_params.options[1].optlen    = sizeof(interval); 
     247 
     248cfg.sockopt_params.options[2].level     = pj_SOL_TCP(); 
     249cfg.sockopt_params.options[2].optname   = TCP_KEEPCNT; 
     250cfg.sockopt_params.options[2].optval    = &probe; 
     251cfg.sockopt_params.options[2].optlen    = sizeof(probe); 
     252 
     253cfg.sockopt_params.options[3].level     = pj_SOL_SOCKET(); 
     254cfg.sockopt_params.options[3].optname   = SO_KEEPALIVE; 
     255cfg.sockopt_params.options[3].optval    = &enable; 
     256cfg.sockopt_params.options[3].optlen    = sizeof(enable); 
     257}}} 
    233258 
    234259== Symbian specific issues and solution == #sym