Ignore:
Timestamp:
Mar 2, 2009 3:48:45 PM (15 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_symbian.h

    r2394 r2481  
    314314    } 
    315315 
     316    // 
     317    // Return true if the access point connection is up 
     318    // 
     319    bool IsConnectionUp() const 
     320    { 
     321        return isConnectionUp_; 
     322    } 
     323 
     324    // 
     325    // Set access point connection status 
     326    // 
     327    void SetConnectionStatus(bool up) 
     328    { 
     329        isConnectionUp_ = up; 
     330    } 
    316331 
    317332    // 
     
    354369 
    355370private: 
     371    bool isConnectionUp_; 
     372     
    356373    bool isSocketServInitialized_; 
    357374    RSocketServ socketServ_; 
     
    375392}; 
    376393 
     394// This macro is used to check the access point connection status and return 
     395// failure if the AP connection is down or unusable. See the documentation 
     396// of pj_symbianos_set_connection_status() for more info 
     397#define PJ_SYMBIAN_CHECK_CONNECTION() \ 
     398    PJ_SYMBIAN_CHECK_CONNECTION2(PJ_ECANCELLED) 
     399 
     400#define PJ_SYMBIAN_CHECK_CONNECTION2(retval) \ 
     401    do { \ 
     402        if (!PjSymbianOS::Instance()->IsConnectionUp()) \ 
     403            return retval; \ 
     404    } while (0); 
    377405 
    378406#endif  /* __OS_SYMBIAN_H__ */ 
Note: See TracChangeset for help on using the changeset viewer.