diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2009-03-02 15:48:45 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2009-03-02 15:48:45 +0000 |
commit | c205201320f80d9e25e554566da5b7f11203f871 (patch) | |
tree | 9c36ccb99099beae87670633c72e63358c95df80 /pjlib/src/pj/os_symbian.h | |
parent | 33e9dc9f2613a86b0fcfea7d669d1b83934d45fd (diff) |
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).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2481 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/os_symbian.h')
-rw-r--r-- | pjlib/src/pj/os_symbian.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pjlib/src/pj/os_symbian.h b/pjlib/src/pj/os_symbian.h index 74ae7f0c..3497e7af 100644 --- a/pjlib/src/pj/os_symbian.h +++ b/pjlib/src/pj/os_symbian.h @@ -313,6 +313,21 @@ public: } } + // + // Return true if the access point connection is up + // + bool IsConnectionUp() const + { + return isConnectionUp_; + } + + // + // Set access point connection status + // + void SetConnectionStatus(bool up) + { + isConnectionUp_ = up; + } // // Unicode Converter @@ -353,6 +368,8 @@ public: } private: + bool isConnectionUp_; + bool isSocketServInitialized_; RSocketServ socketServ_; @@ -374,6 +391,17 @@ private: PjSymbianOS(); }; +// This macro is used to check the access point connection status and return +// failure if the AP connection is down or unusable. See the documentation +// of pj_symbianos_set_connection_status() for more info +#define PJ_SYMBIAN_CHECK_CONNECTION() \ + PJ_SYMBIAN_CHECK_CONNECTION2(PJ_ECANCELLED) + +#define PJ_SYMBIAN_CHECK_CONNECTION2(retval) \ + do { \ + if (!PjSymbianOS::Instance()->IsConnectionUp()) \ + return retval; \ + } while (0); #endif /* __OS_SYMBIAN_H__ */ |