122 // COMASuplConnRequestor::OpenConnection |
122 // COMASuplConnRequestor::OpenConnection |
123 // ----------------------------------------------------------------------------- |
123 // ----------------------------------------------------------------------------- |
124 // |
124 // |
125 void COMASuplConnRequestor::CreateConnectionL() |
125 void COMASuplConnRequestor::CreateConnectionL() |
126 { |
126 { |
127 TBuf<100> iapName; |
127 if(!iIsSettingInitilized) |
|
128 { |
|
129 iState = EInitialState; |
|
130 InitilizeSetting(); |
|
131 } |
|
132 else |
|
133 { |
|
134 TBuf<100> iapName; |
128 TBuf<128> buffer; |
135 TBuf<128> buffer; |
129 iState = EConnecting; |
136 iState = EConnecting; |
130 TBool isIapDialogShown = EFalse; |
137 TBool isIapDialogShown = EFalse; |
131 TInt errorCode = iFallBackHandler->GetNextSLPAddressL(iCurrentSLPId,iHostAddress,iapName,iTls,iPskTls,iLastConnectionError,isIapDialogShown); |
138 TInt errorCode = iFallBackHandler->GetNextSLPAddressL(iCurrentSLPId,iHostAddress,iapName,iTls,iPskTls,iLastConnectionError,isIapDialogShown); |
132 |
139 |
133 if(errorCode == KErrNone) |
140 if(errorCode == KErrNone) |
134 { |
141 { |
135 TBool ret = ConvertIAPNameToIdL(iapName,iIAPId); |
142 TBool ret = ConvertIAPNameToIdL(iapName,iIAPId); |
136 if(!ret) |
143 if(!ret) |
137 { |
144 { |
138 buffer.Copy(_L("No access point configured for ")); |
145 buffer.Copy(_L("No access point configured for ")); |
139 buffer.Append(iHostAddress); |
146 buffer.Append(iHostAddress); |
140 iTrace->Trace(buffer,KTraceFileName, __LINE__); |
147 iTrace->Trace(buffer,KTraceFileName, __LINE__); |
141 if( isIapDialogShown ) |
148 if( isIapDialogShown ) |
142 { |
149 { |
143 TInt err = iProtocolManager.LaunchSettingsUI(this,iHostAddress); |
150 TInt err = iProtocolManager.LaunchSettingsUI(this,iHostAddress); |
144 if(err != KErrNone) |
151 if(err != KErrNone) |
145 { |
152 { |
146 buffer.Copy(_L("Error in launching UI : ")); |
153 buffer.Copy(_L("Error in launching UI : ")); |
147 buffer.AppendNum(err); |
154 buffer.AppendNum(err); |
148 iTrace->Trace(buffer,KTraceFileName, __LINE__); |
155 iTrace->Trace(buffer,KTraceFileName, __LINE__); |
149 iHostAddress.Zero(); |
156 iHostAddress.Zero(); |
150 iObserver.OperationCompleteL(err); |
157 iObserver.OperationCompleteL(err); |
151 } |
158 } |
152 else |
159 else |
153 iIapDialogShown = ETrue; |
160 iIapDialogShown = ETrue; |
154 } |
161 } |
155 |
162 |
156 |
163 |
157 } |
164 } |
158 else |
165 else |
159 { |
166 { |
160 iIsTimeoutDialogTimerStarted = EFalse; |
167 iIsTimeoutDialogTimerStarted = EFalse; |
161 iDialogTimer->Cancel(); |
168 iDialogTimer->Cancel(); |
162 buffer.Copy(_L("Connecting to ")); |
169 buffer.Copy(_L("Connecting to ")); |
163 buffer.Append(iHostAddress); |
170 buffer.Append(iHostAddress); |
164 iTrace->Trace(buffer,KTraceFileName, __LINE__); |
171 iTrace->Trace(buffer,KTraceFileName, __LINE__); |
165 iConnection = iCommMgr.CreateConnectionL(iHostAddress,iTls,iPskTls,iPort,iIAPId); |
172 iConnection = iCommMgr.CreateConnectionL(iHostAddress,iTls,iPskTls,iPort,iIAPId); |
166 OpenConnection(); |
173 OpenConnection(); |
167 } |
174 } |
168 } |
175 } |
169 else |
176 else |
170 { |
177 { |
171 iHostAddress.Zero(); |
178 iHostAddress.Zero(); |
172 iObserver.OperationCompleteL(errorCode); |
179 iObserver.OperationCompleteL(errorCode); |
173 } |
180 } |
|
181 } |
174 } |
182 } |
175 |
183 |
176 // ----------------------------------------------------------------------------- |
184 // ----------------------------------------------------------------------------- |
177 // COMASuplConnRequestor::OpenConnection |
185 // COMASuplConnRequestor::OpenConnection |
178 // ----------------------------------------------------------------------------- |
186 // ----------------------------------------------------------------------------- |