OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio


Welcome Guest ( Log In | Register )

> Http Connection
post Jun 9 2006, 02:45 AM
Post #1

Group: Members
Posts: 5
Joined: 4-January 06
Member No.: 8,854

Hi! Currently I'm developing an application which will deal with the http connection. For the http connection, I will send out my request to download an image. The problem I'm facing right now is when there's no response back for my request, my whole application is hang. I totally unable to exit the application and need to reset the device all the time. Here, I would like to ask whether is there anyone can help me to handle the no response back for the http connection. I'm using the below method for my http connection.

HttpConnection connection = null;
connection = (HttpConnection)Connector.open(url,Connector.READ_WRITE);
DataInputStream iStrm = connection.openDataInputStream();
ByteArrayOutputStream mSrm = null;
int length = (int) connection.getLength();
mData = new byte[length]; mSrm.readFully(mData);

After opening the connector, I need to close the connector when receiving the response back from my request. If there's no response back, my connector is always open and this cause my application hang.

Is there way to close the connector if there's no response back from the request made to http connection?

Please help....

Go to the top of the page
+Quote Post

Posts in this topic
yhat   Http Connection   Jun 9 2006, 02:45 AM
Omicron   QUOTE(yhat @ Jun 9 2006, 05:45 AM)Hi! Cur...   Jun 9 2006, 10:19 AM
Meanie   what you need to do is create a new thread and cal...   Jun 10 2006, 05:20 AM

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 20th May 2018 - 05:47 PM