Ignore:
Timestamp:
Mar 2, 2009 3:48:45 PM (13 years ago)
Author:
nanang
Message:

Ticket #732:

  • Added new Symbian specific API in PJLIB, pj_symbianos_set_connection_status(), to let PJLIB knows the connection status.
  • Added connection status checks before Symbian socket operations.
  • Added loop limiter in Symbian busy_sleep() to avoid the possibility of infinite loop.
  • Added sample of connection monitor in Symbian sample application (ua.cpp).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/os_core_symbian.cpp

    r2394 r2481  
    152152 
    153153PjSymbianOS::PjSymbianOS() 
    154 : isSocketServInitialized_(false), isResolverInitialized_(false), 
     154: isConnectionUp_(false), 
     155  isSocketServInitialized_(false), isResolverInitialized_(false), 
    155156  console_(NULL), selectTimeoutTimer_(NULL), 
    156157  appSocketServ_(NULL), appConnection_(NULL), appHostResolver_(NULL), 
     
    230231    } 
    231232 
     233    isConnectionUp_ = true; 
     234     
    232235    return KErrNone; 
    233236 
     
    240243void PjSymbianOS::Shutdown() 
    241244{ 
     245    isConnectionUp_ = false; 
     246     
    242247    if (isResolverInitialized_) { 
    243248                hostResolver_.Close(); 
     
    253258    } 
    254259 
    255     if (console_) { 
    256         delete console_; 
    257         console_ = NULL; 
    258     } 
    259  
    260     if (selectTimeoutTimer_) { 
    261         delete selectTimeoutTimer_; 
    262         selectTimeoutTimer_ = NULL; 
    263     } 
     260    delete console_; 
     261    console_ = NULL; 
     262 
     263    delete selectTimeoutTimer_; 
     264    selectTimeoutTimer_ = NULL; 
     265     
     266    appSocketServ_ = NULL; 
     267    appConnection_ = NULL; 
     268    appHostResolver_ = NULL; 
     269    appHostResolver6_ = NULL; 
    264270} 
    265271 
     
    304310    PjSymbianOS::Instance()->SetParameters(prm); 
    305311    return PJ_SUCCESS; 
     312} 
     313 
     314 
     315/* Set connection status */ 
     316PJ_DEF(void) pj_symbianos_set_connection_status(pj_bool_t up) 
     317{ 
     318    PjSymbianOS::Instance()->SetConnectionStatus(up != 0); 
    306319} 
    307320 
Note: See TracChangeset for help on using the changeset viewer.