×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    46

    Unable to connect over HTTP

    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
    Regards,

    Vishal

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Unable to connect over HTTP

    Hello vishaljaiswal,

    some questions regarding:

    1) How do you make the call? By using platformRequest() method?

    2) Do you get any exceptions?

    3) Which phone are you using?

    Regards,
    r2j7

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    46

    Re: Unable to connect over HTTP

    Hi,

    Yes I am using platformRequest() method to make a call and I am not getting any type of exception.
    I am using all nokia series 403rd Edition phones.
    Please give a suitable answer.
    Regards,

    Vishal

Similar Threads

  1. Replies: 4
    Last Post: 2007-05-18, 07:17
  2. Unable To Disconnect Http Connection
    By jaceline in forum Mobile Java Networking & Messaging & Security
    Replies: 8
    Last Post: 2006-09-21, 08:23
  3. How to connect HTTP local web server using WTK104(Series 60)?
    By bikerzon in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2003-09-28, 06:01
  4. Replies: 0
    Last Post: 2003-06-20, 03:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×