BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 10-18-2007, 07:19 AM   #1 (permalink)
New Member
 
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: T-Mobile
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default TCP / Prosumer: Unable to open connection

Please Login to Remove!

Hi,

ive an application which is using a Socket Connection to communicate with a java server. On a default BlackBerry (with bes/mds-connection) all works fine. But i have some problems on a prosumer-device with TCP connection. (APN registered in the TCP-Settings)
After five (estimated value) consecutive connections, i got the following Exception: java.io.IOException: Unable to open connection.

I have only 1 connection at the same time and all connections before this Exception are sucessfull established and closed. This Error cannot be reproduced in the simulator.

I have also read the RIM tips and examples:
- The_different_ways_to_make_an_HTTP_or_socket_conne ction
- How To - Close connections


************************************
Here some Sample-Code / Workflow
************************************
try
{
//open connection
conn = (StreamConnection) Connector.open(url);
//After 5 open and closed connections (1 connections at same time), => Exception: Unable to open connection.

//go ahead
//initiate outputstream
//initiate inputstream

//Sending and Receiving Data
- send data
- receiving data
- send data
- receiving data

}
catch (Exception e)
{
... error
}
finally
{
try closing input
try closing output
try closing connection
}
************************************

Ive read in the RIM Document, that TCP supports maximum 5 conenctions at the same time. And if they are not closed correctly, they will block permanent all other connections. But im realy sure, my connections and streams are closed correcly .
Offline  
Old 10-24-2007, 06:11 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Maybe you need to use suffix ";deviceside=true" for this case?
You can see some description here:
RIM Device Java Library: Class Connector
Offline  
Old 11-02-2007, 06:31 AM   #3 (permalink)
New Member
 
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: T-Mobile
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

im already using the suffix "deviceside=true".
Maybe this is a generel problem on prosumerdevices an need to bee fixed by rim?
Offline  
Old 11-02-2007, 07:57 AM   #4 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

no - the error is somewhere in your code. you're the second poster this week who's suggested there's an error with rims os which isn't helpful and spreads doubt. i've been writing http based blackberry apps for 3 years now and the stack is solid - on both bes and bis/direct tcp connections.

check your code more closely and read the javadoc for all your connections and streams - sounds like something somewhere is being left open.
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!

Last edited by jfisher : 11-02-2007 at 07:58 AM.
Offline  
Old 11-02-2007, 11:56 AM   #5 (permalink)
New Member
 
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: T-Mobile
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

weve checked my code and we cannot find any failures or unclosed Connections. We have also installed a sample Application from RIM...same problem occurs while running the sample.

I have installed both applications on different Curve-Prosumerdevices (8300) with the current OS version.....so there is no device-error or something like that.
Offline  
Old 11-02-2007, 12:00 PM   #6 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

is there anything unusual about the connections? how frequent are they?
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 11-02-2007, 12:22 PM   #7 (permalink)
New Member
 
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: T-Mobile
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i think there is nothing unusal in our connections. The sample-application initiate the following connection after the user pressed manually a button:

- open http connection. (size of our sample html-page: 481 Byte)
- reading the page content
- closing streams and conn
- shows the first 10 chars on the screen

We made the connection in a seperate Thread. After the result is shown (maybe 3 seconds) i press the button again. Its a simple connection and the frequent interval was low.
Offline  
Old 11-05-2007, 03:21 AM   #8 (permalink)
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

few more suggestions:
- Is it possible that you open connections simultaneously in different threads?
- Can you add debug output after calling close() method for HttpConnection (not close() for input/ output streams) and make sure that connection is closed?
- Can you make bigger interval between connections (1 minute, for example) and check if it affects the problem?
Offline  
Old 11-05-2007, 04:37 AM   #9 (permalink)
New Member
 
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: T-Mobile
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

thx for ur suggestions, unfortunately it did not solve the problem.

- no, there is only one thread simultaneously open
- there are already debugg-outputs in our functions. We have attached the device in debuggmode in the JDE and all outputs looks good.

- I can try this. But i think this will not help, because we cannot expect from user to wait 1 minute after each screen or data was loaded.
Offline  
Old 11-05-2007, 07:01 AM   #10 (permalink)
New Member
 
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: T-Mobile
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

another info about my problem.

ive installed the (rim) sample application on an another device. This time, its a device in a BES/MDS structure. But we use again the TCP-connection & the suffix "deviceside=false". Same Problem on this device. At the beginning, i thought its a problem on the prosumer device. But now, im sure its a Problem with the TCP connection.

Maybe an APN-Problem?
Ive also asked my carrier for other APN settings...same problem when im using a different apn.

im stumped
Offline  
Old 11-05-2007, 07:46 AM   #11 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i did think it might be carrier specific but everything you've described seems to point to an issue with the client side code.

maybe try on another carrier?

a couple of years ago on an earlier version of bis there was an issue with some carriers and not others - their implementation of bis meant that when tunneling through their wap gateway the first attempt to resolve a dns would fail each and every time, you needed to catch and retry the connection and it'd work on the second attempt.

unrelated to your issue but it shows that what works on one carrier might not on another so it's important to test across as many different combinations of device setups as possible.

[edit - actually if you're already catching a dns error are you still cleaning up properly? this might explain why it runs fine on the simulator but not the device, your network error code might never fire in the simulator]

(another carrier specific issue i've come across involved some transcoding a carrier was doing that was introducing some seemingly random characters into our datastream due to some compression process they were using)
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!

Last edited by jfisher : 11-05-2007 at 07:50 AM.
Offline  
Old 11-05-2007, 08:46 AM   #12 (permalink)
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I didn't meant to fix by waiting 1 minute. I meant just to check if this is a timing issue.
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





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