Hi all,
My application is a complete multimedia solution. My application uses concept of client server and thats why client use hand shaking protocol at application level and uses HTTP POST every after 5 seconds.
In application we show phone contact list and when user press call button on any contact then application makes a call to that number and comes back to application.
But I am facing a problem here. After making call unable to hit any web page and not even http://www.google.com.
Here is sample of code of my application
lHttpConnection = (HttpConnection) Connector.open(iWebPageAddress, Connector.READ_WRITE);
if(null != lHttpConnection)
{
lHttpConnection.setRequestMethod(HttpConnection.POST);
lHttpConnection.setRequestProperty("Connection", "close");
lHttpConnection.setRequestProperty("Accept", "text/plain");
lHttpConnection.setRequestProperty("Content-Length", Integer.toString(iRequestData.length));
}
iCurrState = STATE_WRITING;
if(!iIsCaneled && null != lHttpConnection)
lOutputStream = lHttpConnection.openDataOutputStream();
int totalData = 0;
int dataLength = totalData = iRequestData.length;
iTotalBytesDone = 0;
while(dataLength > 0)
{
if(iIsCaneled)
break;
if(dataLength >= MAX_DATA_CHUNK)
{
if(null != lOutputStream)
lOutputStream.write(iRequestData, iTotalBytesDone, MAX_DATA_CHUNK);
iTotalBytesDone += MAX_DATA_CHUNK;
dataLength -= MAX_DATA_CHUNK;
}
else
{
if(null != lOutputStream)
lOutputStream.write(iRequestData, iTotalBytesDone, dataLength);
dataLength = 0;
iTotalBytesDone += dataLength;
}
}
iResponseData = null;
if(!iIsCaneled)
{
//if(null != lOutputStream)
// lOutputStream.flush();
try
{
if(null != lOutputStream)
{
lOutputStream.flush();
lOutputStream.close();
}
}
catch(IOException iox)
{
lErrorFound = true;
<FAILS EVERY TIME AFTER CALL>
}
iRequestData = null;
int response = -1;
if(!iIsCaneled && !lErrorFound)
{
if(null != lHttpConnection)
response = lHttpConnection.getResponseCode();
if(HttpConnection.HTTP_OK != response)
{
lErrorFound = true;
}
}
AFTER HERE READ STARTS

Reply With Quote

