Couldn't setup connection for http post
Hi,
I was modifying one of my old application. I used http engine from wiki page for http post, which I couldn't found now. It has CClientEngine class. Anyway, my problem is whenever my application starts a http post process it doesn't return any data back. After some work with logs, I found out the problem occurs because of that function.
[CODE]
void CClientEngine::RunL()
{
TInt statusCode = iStatus.Int();
if (!iConnectionSetupDone && statusCode == KErrNone)
{
// Connection done ok
iConnectionSetupDone = ETrue;
// Register for mobility API
iMobility = CActiveCommsMobilityApiExt::NewL(iConnection, *this);
// Start selected HTTP action
switch (iEngineState)
{
case EIdle:
{
CancelTransaction();
break;
}
case EGet:
{
DoHTTPGetL();
break;
}
case EPost:
{
DoHTTPPostL();
break;
}
};
}
else
{
TBuf8<50> errorBuff;
_LIT8(error, "Con Setup Err: %d");
errorBuff.Format(error,statusCode);
MYdebug->Write8(_L8("I"), _L8("RunL"), errorBuff);
}
}
[/CODE]
At that code, function logs error code -30207. I don't know where to look with that error code. Please help me with this problem.
Re: Couldn't setup connection for http post
[QUOTE=Utoto;908211]Hi,
At that code, function logs error code -30207. I don't know where to look with that error code. Please help me with this problem.[/QUOTE]
Hello,
that error code is defined into wlanerrorcodes.h as:
[CODE]/**
* WLAN connection could not be started because one is already active.
* @ingroup rconn_other
*/
const TInt KErrWlanConnAlreadyActive = -30207;
[/CODE]
regards,
pg
Re: Couldn't setup connection for http post
[QUOTE=Utoto;908211]Hi,
I was modifying one of my old application. I used http engine from wiki page for http post, which I couldn't found now. It has CClientEngine class.
[/QUOTE]
Maybe one of those listed in this category?
[url]https://www.developer.nokia.com/Develop/Featured_Technologies/Symbian_C++/Code_examples/Networking.xhtml[/url]
regards
pg
Re: Couldn't setup connection for http post
Hello,
i received you pm: "Hi, thanks for your quick reply. But I couldn't found how to solve that problem. Can you help me with that? how can I make that code use already opened connection. "
You can monitor active connections using Connection Monitor Server API, e.g.:
[url]http://www.developer.nokia.com/document/Cpp_Developers_Library/GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6/html/Connection_Monitor_Server_API4.html[/url]
[url]http://library.developer.nokia.com/index.jsp?topic=/S60_5th_Edition_Cpp_Developers_Library/GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6/html/classRConnectionMonitor.html[/url] (open this twice to go to the real page)
in particular RConnectionMonitor::GetConnectionsCount and RConnectionMonitor::GetConnectionInfo
then you can use the already active connection, e.g. :
[url]http://www.developer.nokia.com/Community/Wiki/CS000825_-_Using_an_already_active_connection[/url]
or you can try to retrieve the active IAP, e.g.:
[url]http://www.developer.nokia.com/Community/Wiki/Retrieving_currently_active_access_point_using_Symbian_C%2B%2B[/url]
hope it helps somehow :-)
pg