diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2010-12-06 15:57:59 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2010-12-06 16:47:44 (GMT) |
commit | 5ef1fb5823a25cd4b27029701f7d707c82750acb (patch) | |
tree | 4febd190edf68fbbf0c399c830b6229c3623ef6a /src/plugins | |
parent | 8dacbccfd89006d1571b3b6ab6e96ea13e74f455 (diff) | |
download | Qt-5ef1fb5823a25cd4b27029701f7d707c82750acb.zip Qt-5ef1fb5823a25cd4b27029701f7d707c82750acb.tar.gz Qt-5ef1fb5823a25cd4b27029701f7d707c82750acb.tar.bz2 |
Use shared socket server session everywhere
Converted uses of RSocketServ in QtNetwork and the symbian bearer plugin
to use the shared session from QtCore instead of creating their own
Reviewed-by: Markus Goetz
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/bearer/symbian/qnetworksession_impl.cpp | 18 | ||||
-rw-r--r-- | src/plugins/bearer/symbian/qnetworksession_impl.h | 2 |
2 files changed, 4 insertions, 16 deletions
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index 53a5b4d..cfb55bf 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -47,6 +47,7 @@ #include <in_sock.h> #include <stdapis/sys/socket.h> #include <stdapis/net/if.h> +#include <private/qcore_symbian_p.h> #ifdef SNAP_FUNCTIONALITY_AVAILABLE #include <cmmanager.h> @@ -65,7 +66,7 @@ QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine) iDynamicUnSetdefaultif(0), ipConnectionNotifier(0), iHandleStateNotificationsFromManager(false), iFirstSync(true), iStoppedByUser(false), iClosedByUser(false), iError(QNetworkSession::UnknownSessionError), iALREnabled(0), - iConnectInBackground(false), isOpening(false) + iConnectInBackground(false), isOpening(false), iSocketServ(qt_symbianGetSocketServer()) { CActiveScheduler::Add(this); @@ -109,7 +110,6 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl() // Cancel possible RConnection::Start() Cancel(); - iSocketServ.Close(); // Close global 'Open C' RConnection // Clears also possible unsetdefaultif() flags. @@ -363,20 +363,9 @@ void QNetworkSessionPrivateImpl::open() iStoppedByUser = false; iClosedByUser = false; - TInt error = iSocketServ.Connect(); - if (error != KErrNone) { - // Could not open RSocketServ - newState(QNetworkSession::Invalid); - iError = QNetworkSession::UnknownSessionError; - emit QNetworkSessionPrivate::error(iError); - syncStateWithInterface(); - return; - } - - error = iConnection.Open(iSocketServ); + TInt error = iConnection.Open(iSocketServ); if (error != KErrNone) { // Could not open RConnection - iSocketServ.Close(); newState(QNetworkSession::Invalid); iError = QNetworkSession::UnknownSessionError; emit QNetworkSessionPrivate::error(iError); @@ -533,7 +522,6 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals) } Cancel(); // closes iConnection - iSocketServ.Close(); // Close global 'Open C' RConnection. If OpenC supports, // close the defaultif for good to avoid difficult timing diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h index 8e3e997..1101d1e 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.h +++ b/src/plugins/bearer/symbian/qnetworksession_impl.h @@ -162,7 +162,7 @@ private: // data RLibrary iOpenCLibrary; TOpenCUnSetdefaultifFunction iDynamicUnSetdefaultif; - mutable RSocketServ iSocketServ; + mutable RSocketServ &iSocketServ; //not owned, shared from QtCore mutable RConnection iConnection; mutable RConnectionMonitor iConnectionMonitor; ConnectionProgressNotifier* ipConnectionNotifier; |