HELP! http connection doesn't works
| Fri, 2006-07-21 13:07 | |
|
hello!
I want to download a file from a server to my nokia n70. On the emulator my app works fine but when I deploy it on the device, the app crashes. My code is: RSocketServ socketServer; User::LeaveIfError(socketServer.Connect()); // Initialise the RConnection. RConnection connection; User::LeaveIfError(connection.Open(socketServer)); // open the IAP communications database CCommsDatabase* commDB = CCommsDatabase::NewL(EDatabaseTypeIAP); CleanupStack::PushL(commDB); // initialize a view CCommsDbConnectionPrefTableView* commDBView = commDB->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionOutgoing); // go to the first record User::LeaveIfError(commDBView->GotoFirstRecord()); // Declare a prefTableView Object. CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref; // read the connection preferences commDBView->ReadConnectionPreferenceL(pref); TUint32 iapID = pref.iBearer.iIapId; // pop and destroy the IAP View CleanupStack::PopAndDestroy(commDBView); // pop and destroy the database object CleanupStack::PopAndDestroy(commDB); // Now we have the iap Id. Use it to connect for the connection. // Create a connection preference variable. TCommDbConnPref connectPref; // start a synchronous connection TInt errConnect = connection.Start(connectPref); m_Session.OpenL(); RStringPool strP = m_Session.StringPool(); RHTTPConnectionInfo connInfo = m_Session.ConnectionInfo(); connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketServ,RHTTPSession::GetTable() ), THTTPHdrVal (socketServer.Handle()) ); TInt connPtr = REINTERPRET_CAST(TInt, &(connection)); connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketConnection,RHTTPSession::GetTable() ), THTTPHdrVal (connPtr) ); RHTTPTransaction transaction = m_Session.OpenTransactionL(m_uri, *m_pCRemoteCourseCallback, RStringF()); transaction.SubmitL(); any ideas? thanks |
|






Forum posts: 104
can you give a little more information here? ie the panic code or whatever.
There is a crafty way of getting a little more info if you are on the device. Normally on the device your app just dies with no further notification. if you install TaskSpy and set notifiy panics ON in the preferences and taskspy is running when your app dies the panic code (if the app is dying due to a panic) will be shown in a dialog.
http://www.symbian.com/Developer/techlib/v9.1docs/doc_source/reference/N10352/index.html
PL