Welcome!

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

Reply
Regular Contributor
Posts: 68
Registered: ‎03-17-2010
My Device: 9000,9500,8900
My Carrier: Airtel,Vodafone
Accepted Solution

Network Problem with XMPP client

Hi all,

 

I am developing an XMPP chat client that needs to establish socket connection. When every time it tries to connect the server it gives me back  the error.

 

net.rim.device.cldc.io.ippp.SocketBaseIOException: Connection timed out: connect

 

and here is the sample code that connects to the XMPP url.

 

 

final StreamConnection connection = (StreamConnection) Connector
					.open("socket://" + hostName + ":" + portName);

 

When I try to get an inputStream based on this connection: It gives me an inputStream with no data in buffer. And that is linked with that exception.

 

 

Can any body tell me what is the reason for this??

 

Thanks in advance.

 

 

 

 

Regular Contributor
Posts: 68
Registered: ‎03-17-2010
My Device: 9000,9500,8900
My Carrier: Airtel,Vodafone

Re: Network Problem with XMPP client

Is anybody there?????

 

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Network Problem with XMPP client

please read the sticky thread about networking.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Regular Contributor
Posts: 68
Registered: ‎03-17-2010
My Device: 9000,9500,8900
My Carrier: Airtel,Vodafone

Re: Network Problem with XMPP client

[ Edited ]

Hi simon,

 

First of all thanks for your reply..

 

Here is the scenario i face.

 

My appliocation runs with two protocols. 1 http for normal web service. and 2. socket:// for xmpp related web services. Which is the part of jxa library.

 

The application runs good when normal http webservice is called. But at the time socket:// web service is called it gives me this exception. That's why i don't think i am facing any network related problems that needs me to read that sticky thread (THOUGH I MAY BE WRONG).

 

Can i check the web service for xmpp so that i can determine whether the problem is web service or not?? Or just i assume that the web service is running properly??

 

 

Thanks.

 

 

 

Highlighted
Regular Contributor
Posts: 68
Registered: ‎03-17-2010
My Device: 9000,9500,8900
My Carrier: Airtel,Vodafone

Re: Network Problem with XMPP client

[ Edited ]

Hi

 

Thanks simon..

 

Find out the solution.....

 

 

Actually the problem was port. We used port 5222 for xmpp push. We use to create a socket connection notify our presence on server.

 

But as this 5222 was blocked we were not able to establish a socket connection there and that made the server unable to accept our request.

 

And that thrown the exception and causes the app to crash.....

 

as a solution we made the port able to listen our request...