×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    14

    is.read is hanging

    Hi all ,
    SE 790i hangs at inputstream.read() or datainputstream.read()
    Has anyone faced similar issue.
    i am reading chunked data in the http responses.
    There is no content length in the response.
    Transfer-Encoding header is chunked in response.

    Would appreciate any help.

    Regards
    Deepak

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: is.read is hanging

    Quote Originally Posted by unread_chapter View Post
    Hi all ,
    1.SE 790i hangs at inputstream.read() or datainputstream.read()
    3.There is no content length in the response.
    1.What about the other handsets,nokia,moto
    2.How you check that...

    what is the response code you are getting?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    14

    Re: is.read is hanging

    response code is 200ok. Body is present in chunks.
    Till now whatever 20-21 devices(includes nokia,motorola,samsung,sony) i have tested i face this issue only in w790i.

    I put a trace before is.read() and after is.read().
    The trace of latter is not shown at all.

    Code is as below

    length = con.getLength(); //con is httpconnector object
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    int b = 0;
    if (length != -1)
    {
    buffer = new byte[(int) length];
    is.readFully(buffer);
    }
    else
    {
    while ((b = is.read()) != -1) {//Device hangs in this loop forever.
    baos.write(b);
    }

    buffer = baos.toByteArray();




    Anyone faced this issue?
    Can you let know if there is any issue in above code

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: is.read is hanging

    Quote Originally Posted by unread_chapter View Post

    I put a trace before is.read() and after is.read().
    The trace of latter is not shown at all.

    Code is as below

    length = con.getLength(); //con is httpconnector object
    is = con.openInputStream();

    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    int b = 0;
    if (length != -1)
    {
    buffer = new byte[(int) length];
    is.readFully(buffer);
    }
    else
    {
    while ((b = is.read()) != -1) {//Device hangs in this loop forever.
    baos.write(b);
    }

    buffer = baos.toByteArray();




    Anyone faced this issue?
    Can you let know if there is any issue in above code
    Hi,
    Yeah,that will off course hangs there,
    Can you please tell me that where you are opening the input stream..
    like
    is = con.openInputStream();

    I Just add this line (see inner quoted one - Blue color..
    please check that whether you can processed forward after this,let me know.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Registered User
    Join Date
    Jan 2009
    Posts
    32

    Re: is.read is hanging

    The code was just a snippet.
    I just missed it while writing on post.

    THe code works well in all devices(ones on which i tested) currently and does not on k790i(sorry last time mentioned w790 wrongly).


    The code works perfectly also on wtk emulator.
    Please let me know if you need any other info.

    Regards
    Deepak

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: is.read is hanging

    Hi,
    there two ways,
    first There are a lot of demo examples on the web,just search and use the code...
    and the secondly you have to do testing and debugging for the issue you are facing...on the Device.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Jan 2009
    Posts
    32

    Re: is.read is hanging

    ok, i will do that .

    But is there any known issue of hanging in inputstream.read() forever whenever the chunked responses are received.

    Please look into the below link. The same thing is happening.
    http://discussion.forum.nokia.com/fo...p/t-18732.html

    Is there any solution to handle chunked responses properly.

    Regards
    Deepak

  8. #8
    Registered User
    Join Date
    Jan 2009
    Posts
    32

    Re: is.read is hanging

    Any help would be appreciated.

    Regards
    Deepak

Similar Threads

  1. Replies: 3
    Last Post: 2008-06-03, 12:22
  2. Replies: 4
    Last Post: 2008-02-27, 19:31
  3. Nokia 6610 Microphone Hanging
    By saurabhmukadam in forum General Development Questions
    Replies: 1
    Last Post: 2004-02-25, 13:02
  4. Serious hanging prob in Jbuilder5 with 40Series SDK
    By farhanx in forum Mobile Java General
    Replies: 0
    Last Post: 2003-12-13, 20:56
  5. Serious hanging prob in Jbuilder5 with 40S
    By farhanx in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2003-12-13, 20:53

Posting Permissions

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