Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 19
Registered: ‎07-21-2008
My Device: Not Specified

Open Tunnel

[ Edited ]

Hello Sir,

i am developed an application in BlackBerry 8100 .

That application is connect the network and get response from server .

i was run my code in BlackBerry device that time i got IOException is - Open Tunnel max timeout .

What can i do sir, My network service provider unable to provide APN setting for me.

StreamConnection s = null;

try {

s = (StreamConnection)Connector.open(getUrl());

InputStream input = s.openInputStream();

byte[] data = new byte[256];

int len = 0; StringBuffer raw = new StringBuffer();

while ( -1 != (len = input.read(data)) ) {

raw.append(new String(data, 0, len));


//convert raw data to

String format String text = raw.toString();

//invoke updateContent method to display retrieved text


//close the input stream


//close the stream connection

s.close(); }

atch (IOException e)





That is my code.................

My application is work well on MDS Simulator.

Please help me...................

Message Edited by skylark on 08-13-2008 01:42 PM
BlackBerry Development Advisor
Posts: 15,882
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Open Tunnel

Do you mean that your account does not allow for direct TCP connections, or that you do not know the APN settings to create a direct TCP connection?  This is required for a direct TCP connection.


Or you can make a connection through a BlackBerry Enterprise Server (deviceside=false) or the carrier's WAP gateway (although this also requires information from the carrier).  This link explains the connection routes available on BlackBerry.




Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.