×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    151

    Very Challenging HTTPConnection Problem

    Hi All

    I am using HTTPCOnnection in my MIDlet.
    I do it with the help of Connector.open(URL)
    After this I read data from connection through InputStream.

    But The problem I am facing is once i read data from this connection it goes fine but when I read it again it gives problem.

    Does anybody know how to resolve this.

    Thanks and Regards,
    Manan
    Cheers,
    Manan

  2. #2
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: Very Challenging HTTPConnection Problem

    hi,

    have you:
    - started separate thread (non-blocking):
    - closed connection
    - closed input stream
    so e.g. your run() method ceased?
    here is an example of using http connection to load/parser rss feed:
    http://discussion.forum.nokia.com/fo...26&postcount=7
    regards,
    Peter

  3. #3
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    151

    Re: Very Challenging HTTPConnection Problem

    Ya I have done all these things.
    But I think the problem is my application is using cache due to which I am getting problem
    Cheers,
    Manan

  4. #4
    Registered User
    Join Date
    Jul 2003
    Posts
    14

    Re: Very Challenging HTTPConnection Problem

    Hi,

    One point:
    - Emulator or real phone?

    A common mistake, is to not close the http connection:
    httpconnection.setRequestProperty("Connection", "close");

    Also to be sure to not cache data:
    httpconnection.setRequestProperty("Cache-Control", "no-cache");

    I sometime use this trick to force new request:
    req += "&rnd="+System.currentTimeMillis();
    httpconnection = (HttpConnection)Connector.open(req);


    Best,

    Mik

  5. #5
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280

    Re: Very Challenging HTTPConnection Problem

    Quote Originally Posted by MananW
    But The problem I am facing is once i read data from this connection it goes fine but when I read it again it gives problem.
    What do you mean by "read it[the data] again"?

    Are you trying to reuse the connection? Are you trying to reset the stream and read it from the beginning? Are you reading part of the data, then doing something else, then reading the rest? Are you reconnecting to the same URL using a new connection?

    And what problem does it give exactly?

    shmoove

Similar Threads

  1. Problem MMC+USB Connection
    By Fede81 in forum Symbian
    Replies: 1
    Last Post: 2007-06-14, 06:13
  2. Problem MMC+USB Connection
    By Fede81 in forum General Development Questions
    Replies: 3
    Last Post: 2006-07-19, 15:21
  3. Challenging Sound Problem on 9210
    By MananW in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2005-10-28, 08:27
  4. Problem with HttpConnection (URGENT)
    By bhandari in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2004-01-08, 23:39
  5. 7210 HttpConnection problem
    By joey829 in forum Mobile Java General
    Replies: 3
    Last Post: 1970-01-01, 02:00

Posting Permissions

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