07-10-2010 06:16 AM
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.
Solved! Go to Solution.
07-12-2010 07:01 AM
please read the sticky thread about networking.
07-12-2010 07:18 AM - edited 07-12-2010 07:21 AM
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??
07-14-2010 01:08 AM - edited 07-14-2010 01:10 AM
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...