javaextensions/wma/sms_cbs/pushplugin/sms/src.s60/smsserverconnection.cpp
branchRCL_3
changeset 60 6c158198356e
parent 24 0fd27995241b
child 83 26b2b12093af
equal deleted inserted replaced
59:e5618cc85d74 60:6c158198356e
    70     delete mMessage;
    70     delete mMessage;
    71     delete mFilterDes;
    71     delete mFilterDes;
    72     delete mOpenMonitor;
    72     delete mOpenMonitor;
    73 }
    73 }
    74 
    74 
    75 void SmsServerConnection::open(ConnectionListener* aListener,
    75 OS_EXPORT void SmsServerConnection::open(ConnectionListener* aListener,
    76                                bool aIsAppLaunched)
    76                                bool aIsAppLaunched)
    77 {
    77 {
    78     JELOG2(EWMA);
    78     JELOG2(EWMA);
    79     mIsAppLaunched = aIsAppLaunched;
    79     mIsAppLaunched = aIsAppLaunched;
    80     SmsServerConnection::open(aListener);
    80     SmsServerConnection::open(aListener);
   209         mListener->error(mUri, err, "Error Receiving Message");
   209         mListener->error(mUri, err, "Error Receiving Message");
   210         mState = EReceivingMessageForNotify;
   210         mState = EReceivingMessageForNotify;
   211         mIoctlBuf() = KSockSelectRead;
   211         mIoctlBuf() = KSockSelectRead;
   212         mSocket.Ioctl(KIOctlSelect, iStatus, &mIoctlBuf, KSOLSocket);
   212         mSocket.Ioctl(KIOctlSelect, iStatus, &mIoctlBuf, KSOLSocket);
   213         SetActive();
   213         SetActive();
       
   214         pthread_mutex_unlock(&mMutex);
   214         return;
   215         return;
   215     }
   216     }
   216     switch (mState)
   217     switch (mState)
   217     {
   218     {
   218     case EReceivingMessageForNotify:
   219     case EReceivingMessageForNotify:
   274     case EExit:
   275     case EExit:
   275     {
   276     {
   276         pthread_cond_signal(&mCondVar);
   277         pthread_cond_signal(&mCondVar);
   277         mIsRunning = EFalse;
   278         mIsRunning = EFalse;
   278         CActiveScheduler::Stop();
   279         CActiveScheduler::Stop();
       
   280         break;
   279     }
   281     }
   280     default:
   282     default:
   281     {
   283     {
   282         LOG(EWMA, EInfo, "SMS : Not a valid case");
   284         LOG(EWMA, EInfo, "SMS : Not a valid case");
   283         break;
   285         break;
   297         User::LeaveIfError(mSocketServer.ShareAuto());
   299         User::LeaveIfError(mSocketServer.ShareAuto());
   298     }
   300     }
   299 }
   301 }
   300 
   302 
   301 
   303 
   302 void SmsServerConnection::close()
   304 OS_EXPORT void SmsServerConnection::close()
   303 {
   305 {
   304     JELOG2(EWMA);
   306     JELOG2(EWMA);
   305     // the close and RunL are synchronized to make it SMP safe.
   307     // the close and RunL are synchronized to make it SMP safe.
   306     if (mState != EExit && mIsListening)
   308     if (mState != EExit && mIsListening)
   307     {
   309     {