| author | Petteri Saari <petteri.saari@digia.com> |
| Fri, 26 Nov 2010 12:09:49 +0200 | |
| branch | MSRP_FrameWork |
| changeset 59 | b365c991829c |
| parent 58 | cdb720e67852 |
| permissions | -rw-r--r-- |
|
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
1 |
/* |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
2 |
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
3 |
* All rights reserved. |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html." |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
8 |
* Initial Contributors: |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
9 |
* Nokia Corporation - initial contribution. |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
10 |
* Contributors: |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
11 |
* |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
12 |
* Description: |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
13 |
* MSRP Implementation |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
14 |
* |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
15 |
*/ |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
16 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
17 |
// INTERNAL INCLUDES |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
18 |
#include "CMSRPConnector.h" |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
19 |
#include "MSRPCommon.h" |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
20 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
21 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
22 |
// CMSRPConnListener::NewL |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
23 |
// Static constructor |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
24 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
25 |
// |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
26 |
/*static*/ MMSRPConnector* CMSRPConnector::NewL(MMSRPConnectionManager& aConnMngr, MMSRPConnectorObserver& aConnection) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
27 |
{
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
28 |
MSRPLOG( "CMSRPConnector::NewL enter" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
29 |
CMSRPConnector* self = new (ELeave) CMSRPConnector( aConnMngr, aConnection ); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
30 |
CleanupStack::PushL(self); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
31 |
self->ConstructL(); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
32 |
CleanupStack::Pop(self); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
33 |
MSRPLOG( "CMSRPConnector::NewL exit" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
34 |
return self; |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
35 |
} |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
36 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
37 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
38 |
// CMSRPConnector::CMSRPConnector |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
39 |
// Constructor |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
40 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
41 |
// |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
42 |
CMSRPConnector::CMSRPConnector(MMSRPConnectionManager& aConnMngr, MMSRPConnectorObserver& aConnection) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
43 |
: CActive(CActive::EPriorityStandard), iConnMngr(aConnMngr), iConnection( aConnection ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
44 |
{
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
45 |
CActiveScheduler::Add(this); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
46 |
} |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
47 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
48 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
49 |
// CMSRPConnector::~CMSRPConnector |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
50 |
// Destructor |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
51 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
52 |
// |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
53 |
CMSRPConnector::~CMSRPConnector() |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
54 |
{
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
55 |
MSRPLOG( "CMSRPConnector::~CMSRPConnector enter" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
56 |
delete iTimer; |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
57 |
Cancel(); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
58 |
if(iSocket) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
59 |
{
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
60 |
iSocket->Close(); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
61 |
delete iSocket; |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
62 |
} |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
63 |
MSRPLOG( "CMSRPConnector::~CMSRPConnector exit" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
64 |
} |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
65 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
66 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
67 |
// CMSRPConnector::ConstructL |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
68 |
// 2nd phase constructor |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
69 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
70 |
// |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
71 |
void CMSRPConnector::ConstructL() |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
72 |
{
|
|
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
73 |
MSRPLOG( "-> CMSRPConnector::ConstructL" ) |
|
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
74 |
//iState = ENotConnected; |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
75 |
iTimer = CMSRPTimeOutTimer::NewL( *this ); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
76 |
//create socket |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
77 |
|
|
58
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
78 |
iSocket = new (ELeave) RSocket(); |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
79 |
RSocketServ& socketServ = iConnMngr.SocketServer(); |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
80 |
RConnection& connection = iConnMngr.SocketServerConn(); |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
81 |
TInt error = iSocket->Open( socketServ, KAfInet, KSockStream, KProtocolInetTcp, connection ); |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
82 |
MSRPLOG2( "CMSRPConnector::ConstructL = open error = %d", error ) |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
83 |
if ( error ) |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
84 |
{
|
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
85 |
// if open fails, let's try to restart connection |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
86 |
MSRPLOG( "CMSRPConnector::ConstructL restarting interface" ) |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
87 |
iConnMngr.ReStartInterface(); |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
88 |
error = iSocket->Open( socketServ, KAfInet, KSockStream, KProtocolInetTcp, connection ); |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
89 |
} |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
90 |
User::LeaveIfError( error ); |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
91 |
error = iSocket->SetOpt( KSoReuseAddr, KSolInetIp, ETrue ); |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
92 |
MSRPLOG2( "CMSRPConnector::ConstructL = opt error = %d", error ) |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
93 |
User::LeaveIfError( error ); |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
94 |
iSocket->SetLocalPort( KMsrpPort ); |
|
cdb720e67852
This release addresses the following issues:
Petteri Saari <petteri.saari@digia.com>
parents:
25
diff
changeset
|
95 |
MSRPLOG( "<- CMSRPConnector::ConstructL" ) |
|
25
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
96 |
} |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
97 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
98 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
99 |
// CMSRPConnector::DoCancel |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
100 |
// Cancels outstanding request. |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
101 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
102 |
// |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
103 |
void CMSRPConnector::DoCancel() |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
104 |
{
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
105 |
MSRPLOG( "CMSRPConnector::DoCancel enter" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
106 |
iSocket->CancelConnect(); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
107 |
MSRPLOG( "CMSRPConnector::DoCancel exit" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
108 |
} |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
109 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
110 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
111 |
// CMSRPConnector::Connect |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
112 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
113 |
// |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
114 |
void CMSRPConnector::Connect(TInetAddr& aRemoteAddr) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
115 |
{
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
116 |
MSRPLOG( "CMSRPConnector::Connect enter" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
117 |
iSocket->Connect( aRemoteAddr, iStatus ); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
118 |
//iState = EConnecting; |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
119 |
SetActive(); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
120 |
iTimer->After( KTimeOutInSeconds * KSecondinMicroseconds ); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
121 |
MSRPLOG( "CMSRPConnector::Connect exit" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
122 |
} |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
123 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
124 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
125 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
126 |
// CMSRPConnector::TimerExpired |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
127 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
128 |
// |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
129 |
void CMSRPConnector::TimerExpiredL() |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
130 |
{
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
131 |
MSRPLOG( "CMSRPConnector::TimerExpired enter" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
132 |
iConnection.ConnectionEstablishedL(MMSRPConnection::EConnectTimedOut, iSocket, KErrTimedOut); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
133 |
MSRPLOG( "CMSRPConnector::TimerExpired exit" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
134 |
} |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
135 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
136 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
137 |
// CMSRPConnector::RunL |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
138 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
139 |
// |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
140 |
void CMSRPConnector::RunL() |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
141 |
{
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
142 |
MSRPLOG( "CMSRPConnector::RunL enter" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
143 |
iTimer->Cancel(); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
144 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
145 |
if(iStatus.Int() != KErrNone) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
146 |
{
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
147 |
MSRPLOG2( "CMSRPConnector::RunL Connection Error %d", iStatus.Int() ); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
148 |
iConnection.ConnectionEstablishedL(MMSRPConnection::EError, iSocket, iStatus.Int()); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
149 |
return; |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
150 |
} |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
151 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
152 |
iConnection.ConnectionEstablishedL(MMSRPConnection::EConnected, iSocket, KErrNone); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
153 |
MSRPLOG( "CMSRPConnector::RunL exit" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
154 |
} |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
155 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
156 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
157 |
// CMSRPConnector::RunError |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
158 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
159 |
// |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
160 |
TInt CMSRPConnector::RunError(TInt aError) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
161 |
{
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
162 |
//handle error delete connector on error |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
163 |
//make sure ConnectorStateL does not leave on EError |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
164 |
MSRPLOG( "CMSRPConnector::RunError enter" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
165 |
TRAPD(err, iConnection.ConnectionEstablishedL(MMSRPConnection::EError, iSocket, aError)); |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
166 |
MSRPLOG( "CMSRPConnector::RunError exit" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
167 |
return err; |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
168 |
} |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
169 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
170 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
171 |
// CMSRPConnector::ConnectComplete |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
172 |
// ----------------------------------------------------------------------------- |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
173 |
// |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
174 |
void CMSRPConnector::ConnectComplete() |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
175 |
{
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
176 |
MSRPLOG( "CMSRPConnector::ConnectComplete enter" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
177 |
iSocket = NULL; |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
178 |
MSRPLOG( "CMSRPConnector::ConnectComplete exit" ) |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
179 |
} |
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
180 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
181 |
|
|
505ad3f0ce5c
MSRP Chat and File Sharing FrameWork - Initial Contribution from Nokia.
shivsood
parents:
diff
changeset
|
182 |
// End of File |