BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 03-06-2007, 06:12 PM   #1 (permalink)
New Member
 
Join Date: Mar 2007
Model: 8700
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default httpconnection timeout semantics

Please Login to Remove!

When I set the timeout on an HttpConnection, as in

Code:
HttpConnection conn = (HttpConnection)Connector.open(myURL + ";ConnectionTimeout=120000;deviceside=false");
is this timeout a limit on
(a) the total time a blocking operation can take or
(b) the amount of time a blocking operation can go without receiving data over the connection or
(c) something else

For example, suppose I have the following code:

Code:
HttpConnection conn = (HttpConnection)Connector.open(myURL + ";ConnectionTimeout=120000;deviceside=false");
int rc = conn.getResponseCode();
if (rc != HttpConnection.HTTP_OK) {
    // Handle failure response from server
}
InputStream is = _connection.openInputStream();
int len = (int)_connection.getLength();
if (len > -1) {
    byte[] data = new byte[len];
    is.read(data);
}
Is it possible for the read() call to take more than 2 minutes? For example, suppose there is no signal for 1:59, then the client receives some data, then there's no signal for another 1:59, etc. Is this possible? Or is the 2 min a hard limit on the duration of the read() call?

Thanks in advance...
Offline  
Old 03-13-2007, 09:08 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

bric,
The timeout signals to the thread managing the connection how long to wait before throwing an InterruptedIOException signifying a timeout. Also, in a quirk of java's connection framework, this thread will hold at getLength and throw from there, not read or open, as one might expect.
Offline  
Closed Thread


Thread Tools

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

ST Memory Tools Serial Flash Evaluation Kit Programmer USB w. Cable assy - USED
$20.0
ST Memory Tools Serial Flash Evaluation Kit Programmer USB w. Cable assy - USED pictureLEUCHTTURM1917 343552 Some Lines a Day, 5 Year Memory Book
$44.79
LEUCHTTURM1917 343552 Some Lines a Day, 5 Year Memory Book  picture1pc Honeywell Memory Module 620-0027
$261.09
1pc Honeywell Memory Module 620-0027 picture1PC NEW Schneider PLC Sram Memory Card TSXMRPC003M *SHIP TODAY*
$1099.8
1PC NEW Schneider PLC Sram Memory Card TSXMRPC003M *SHIP TODAY* pictureNew In Box Siemens memory card 6ES5376-1AA21 6ES5 376-1AA21 1 year warranty
$105.0
New In Box Siemens memory card 6ES5376-1AA21 6ES5 376-1AA21 1 year warranty picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.