You Are Here:

Community: Developer Discussion Boards

#1 Old is.read is hanging - 2009-04-09, 07:45

Join Date: Jul 2008
Posts: 14
unread_chapter
Offline
Registered User
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
Reply With Quote

#2 Old Thumbs up Re: is.read is hanging - 2009-04-09, 08:10

Join Date: Mar 2008
Posts: 2,161
Location: The Capital of I N D I A
Send a message via Skype™ to raj_J2ME
raj_J2ME's Avatar
raj_J2ME
Offline
Forum Nokia Champion
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

R a j - The K e r n e l
Reply With Quote

#3 Old Re: is.read is hanging - 2009-04-09, 08:39

Join Date: Jul 2008
Posts: 14
unread_chapter
Offline
Registered User
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
Reply With Quote

#4 Old Thumbs up Re: is.read is hanging - 2009-04-09, 11:02

Join Date: Mar 2008
Posts: 2,161
Location: The Capital of I N D I A
Send a message via Skype™ to raj_J2ME
raj_J2ME's Avatar
raj_J2ME
Offline
Forum Nokia Champion
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
Quote:
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
Quote:
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

R a j - The K e r n e l
Reply With Quote

#5 Old Re: is.read is hanging - 2009-04-09, 13:13

Join Date: Jan 2009
Posts: 32
mawandia
Offline
Registered User
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
Reply With Quote

#6 Old Thumbs up Re: is.read is hanging - 2009-04-09, 14:15

Join Date: Mar 2008
Posts: 2,161
Location: The Capital of I N D I A
Send a message via Skype™ to raj_J2ME
raj_J2ME's Avatar
raj_J2ME
Offline
Forum Nokia Champion
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

R a j - The K e r n e l
Reply With Quote

#7 Old Re: is.read is hanging - 2009-04-09, 14:53

Join Date: Jan 2009
Posts: 32
mawandia
Offline
Registered User
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
Reply With Quote

#8 Old Re: is.read is hanging - 2009-04-10, 09:06

Join Date: Jan 2009
Posts: 32
mawandia
Offline
Registered User
Any help would be appreciated.

Regards
Deepak
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
CleanupStack::PushL(scheduler) makes new thread hanging on emulator ababo General Symbian C++ 3 2008-06-03 13:22
download routine in a separate thread to avoid app from hanging? novis Python 4 2008-02-27 20:31
Nokia 6610 Microphone Hanging saurabhmukadam General Discussion 1 2004-02-25 14:02
Serious hanging prob in Jbuilder5 with 40Series SDK farhanx Mobile Java General 0 2003-12-13 21:56
Serious hanging prob in Jbuilder5 with 40S farhanx Mobile Java Tools & SDKs 0 2003-12-13 21:53

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia