Msrp/MsrpClient/src/RMSRPSession.cpp
branchMSRP_FrameWork
changeset 58 cdb720e67852
parent 25 505ad3f0ce5c
equal deleted inserted replaced
25:505ad3f0ce5c 58:cdb720e67852
    31     {
    31     {
    32     MSRPLOG("RMSRP Session.. Ctor");
    32     MSRPLOG("RMSRP Session.. Ctor");
    33     }
    33     }
    34 
    34 
    35 
    35 
    36 TInt RMSRPSession::CreateServerSubSession( RMSRP& aRMSRP, const TUint32 aIapId )
    36 TInt RMSRPSession::CreateServerSubSession( 
       
    37     RMSRP& aRMSRP, 
       
    38     const TUint32 aIapId,
       
    39     const TDesC8& aSessionId )
    37     {
    40     {
    38     MSRPLOG("RMSRP Session.. Create client-server SubSession");
    41     MSRPLOG("RMSRP Session.. Create client-server SubSession");
    39     
    42     TBuf<200 > koe;
    40     return CreateSubSession( aRMSRP, EMSRPCreateSubSession, TIpcArgs( aIapId ) );
    43     koe.Copy( aSessionId );
       
    44     MSRPLOG2("RMSRP Session.. Create client-server SubSession, %S", &koe );
       
    45     
       
    46     return CreateSubSession( aRMSRP, EMSRPCreateSubSession, TIpcArgs( aIapId, &aSessionId ) );
    41     }
    47     }
    42 
    48 
    43 
    49 
    44 void RMSRPSession::CloseServerSubSession( )
    50 void RMSRPSession::CloseServerSubSession( )
    45     {
    51     {
    46     MSRPLOG("RMSRP Session.. Close client-server SubSession");
    52     MSRPLOG("RMSRP Session.. Close client-server SubSession");
    47     CloseSubSession(EMSRPCloseSubSession);
    53     CloseSubSession(EMSRPCloseSubSession);
    48     }
    54     }
    49 
    55 
    50 
    56 
    51 void RMSRPSession::GetLocalPathL( TDes8 &aLocalHost, TDes8 &aSessionID )
    57 void RMSRPSession::GetLocalPathL( TDes8 &aLocalHost )
    52     {
    58     {
    53     MSRPLOG("RMSRP Session.. GetLocalPath");
    59     MSRPLOG("RMSRP Session.. GetLocalPath");
    54     
    60     
    55     User::LeaveIfError( SendReceive(EMSRPLocalPath, TIpcArgs( &iLocalPathMSRPDataPckg )) );
    61     User::LeaveIfError( SendReceive(EMSRPLocalPath, TIpcArgs( &iLocalPathMSRPDataPckg )) );
    56     
    62     
    57     aLocalHost = iLocalPathMSRPDataPckg().iLocalHost;
    63     aLocalHost = iLocalPathMSRPDataPckg().iLocalHost;
    58     aSessionID = iLocalPathMSRPDataPckg().iSessionID;    
       
    59     }
    64     }
    60 
    65 
    61 
    66 
    62 void RMSRPSession::Connect( const TDesC8& aRemoteHost,
    67 void RMSRPSession::Connect( const TDesC8& aRemoteHost,
    63                             const TUint aRemotePort,
    68                             const TUint aRemotePort,
    85     iListenMSRPDataPckg().iRemoteHost = aRemoteHost;
    90     iListenMSRPDataPckg().iRemoteHost = aRemoteHost;
    86     iListenMSRPDataPckg().iRemotePort = aRemotePort;
    91     iListenMSRPDataPckg().iRemotePort = aRemotePort;
    87     iListenMSRPDataPckg().iRemoteSessionID = aRemoteSessionID;
    92     iListenMSRPDataPckg().iRemoteSessionID = aRemoteSessionID;
    88     iListenMSRPDataPckg().iIsMessage = aIsMessage;
    93     iListenMSRPDataPckg().iIsMessage = aIsMessage;
    89         
    94         
    90     SendReceive( EMSRPListenConnections, TIpcArgs( &iListenMSRPDataPckg ), aStatus );    
    95     SendReceive( EMSRPListenConnections, TIpcArgs( &iListenMSRPDataPckg ), aStatus );   
       
    96     SendReceive( EMSRPProcessQueuedRequests );
    91     }
    97     }
    92 
    98 
    93 
    99 
    94 void RMSRPSession::ListenMessages( TBool aIsMessage,
   100 void RMSRPSession::ListenMessages( TBool aIsMessage,
    95                                    TRequestStatus& aStatus )
   101                                    TRequestStatus& aStatus )
   120 
   126 
   121     return SendReceive( EMSRPSendMessage, TIpcArgs( &iSendMSRPDataPckg ) );
   127     return SendReceive( EMSRPSendMessage, TIpcArgs( &iSendMSRPDataPckg ) );
   122     }
   128     }
   123 
   129 
   124 
   130 
   125 TInt RMSRPSession::CancelSending( TDesC8& aMessageId )
   131 TInt RMSRPSession::CancelSending( const TDesC8& aMessageId )
   126     {
   132     {
   127     MSRPLOG("RMSRP Session.. CancelSending");
   133     MSRPLOG("RMSRP Session.. CancelSending");
   128     return SendReceive( EMSRPCancelSending, TIpcArgs( &aMessageId ) );
   134     return SendReceive( EMSRPCancelSending, TIpcArgs( &aMessageId ) );
   129     }
   135     }
   130 
   136 
   131 
   137 
   132 void RMSRPSession::CancelReceiving( )
   138 TInt RMSRPSession::CancelReceiving( const TDesC8& aMessageId )
   133     {
   139     {
   134     MSRPLOG("RMSRP Session.. CancelReceiving Entered");
   140     MSRPLOG("RMSRP Session.. CancelReceiving Entered");
   135     SendReceive( EMSRPCancelReceiving );
   141     return SendReceive( EMSRPCancelReceiving, TIpcArgs( &aMessageId ) );
   136     MSRPLOG("RMSRP Session.. CancelReceiving Done ");
       
   137     }
   142     }
   138     
   143     
   139 
   144 
   140 void RMSRPSession::CancelSendResultListening( )
   145 void RMSRPSession::CancelSendResultListening( )
   141     {
   146     {
   205     {
   210     {
   206     MSRPLOG("RMSRP Session.. GetTotalBytes");
   211     MSRPLOG("RMSRP Session.. GetTotalBytes");
   207     return iSendResultListenMSRPDataPckg().iTotalBytes;
   212     return iSendResultListenMSRPDataPckg().iTotalBytes;
   208     }
   213     }
   209 
   214 
   210 
   215 // -----------------------------------------------------------------------------
   211 TInt RMSRPSession::SendFileL(TDesC8& aFileParamBuffer)
   216 // RMSRPSession::ListenMessageId
   212     {
   217 // -----------------------------------------------------------------------------
   213     /* Send File Params to the sub-session */
   218 //
   214     MSRPLOG("RMSRP Session.. SendFileParams");
   219 TDesC8& RMSRPSession::ListenMessageId()
   215     iSendMSRPDataPckg().iExtMessageBuffer = aFileParamBuffer;
   220     {
   216     return SendReceive( EMSRPSendFile, TIpcArgs( &iSendMSRPDataPckg ) );
   221     return iListenMSRPDataPckg().iMessageId;
   217     }
   222     }
   218 
   223 
   219 TInt RMSRPSession::ReceiveFileL(TDesC8& aFileParamBuffer)
   224 // -----------------------------------------------------------------------------
   220     {
   225 // RMSRPSession::SendMessageId
   221     /* Send File Params to the sub-session */
   226 // -----------------------------------------------------------------------------
   222     MSRPLOG("RMSRP Session.. SendFileParams");
   227 //
   223     iSendMSRPDataPckg().iExtMessageBuffer = aFileParamBuffer;
   228 TDesC8& RMSRPSession::SendMessageId()
   224     return SendReceive( EMSRPReceiveFile, TIpcArgs( &iSendMSRPDataPckg ) );
   229     {
   225     }
   230     return iSendResultListenMSRPDataPckg().iMessageId;
       
   231     }
       
   232 
       
   233 // -----------------------------------------------------------------------------
       
   234 // RMSRPSession::SendMessageId
       
   235 // -----------------------------------------------------------------------------
       
   236 //
       
   237 TInt  RMSRPSession::SetProgressReports( TBool aProgress )
       
   238     {
       
   239     return SendReceive( EMSRPProgressReports, TIpcArgs( aProgress ) );
       
   240     }
       
   241 
   226 #endif /* RMSRPSESSION_CPP_ */
   242 #endif /* RMSRPSESSION_CPP_ */
       
   243 
       
   244 // End of file