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

Gikfun USB Programmer CH341A Series Burner Chip 24 EEPROM BIOS Writer 25 SPI
$10.69
Gikfun USB Programmer CH341A Series Burner Chip 24 EEPROM BIOS Writer 25 SPI pictureWL Baseband Logic EEPROM IC Module Read Write IMEI Tool For IPhone 7 / 7 Plus
$99.68
WL Baseband Logic EEPROM IC Module Read Write IMEI Tool For IPhone 7 / 7 Plus pictureWINBOND W27C010 27C010 1Mbit EEPROM DIP32 X 10pcs A
$12.99
WINBOND W27C010 27C010 1Mbit EEPROM DIP32 X 10pcs A pictureWINBOND W27C512P W27C512 27C512 512Kbit EEPROM PLCC32 10pcs
$11.98
WINBOND W27C512P W27C512 27C512 512Kbit EEPROM PLCC32  10pcs pictureZ180 MPU Kits ZILOG Z8S18033VSC + 128K SRAM TC551001 + W27C020 EEPROM
$6.98
Z180 MPU Kits ZILOG Z8S18033VSC + 128K SRAM TC551001 + W27C020 EEPROM picture






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