Sunday, June 20, 2010

[android-developers] TCP connections from android device as client

Hello,

I am trying to do a simple program where in I need to communicate
between a TCP Server and a client (android device). First I simulated
the complete communication on local server and things worked fine. Now
I tried to test it from device. I installed my activity on the device
and tried to connect to the server.

The server has IP address 192.168.2.8 and the client has ip address
192.168.2.11. Both are connected to the same wireless point. The
connection from client to server is never successful. It always times
out.
I get following exception -

java.net.SocketException: The operation timed out
E/ClientActivity( 1166): at
org.apache.harmony.luni.platform.OSNetworkSystem.connectSocketImpl(Native
Method)
E/ClientActivity( 1166): at
org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:
114)
E/ClientActivity( 1166): at
org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:
245)
E/ClientActivity( 1166): at
org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:
220)
E/ClientActivity( 1166): at
java.net.Socket.startupSocket(Socket.java:780)
E/ClientActivity( 1166): at java.net.Socket.<init>(Socket.java:
314)
E/ClientActivity( 1166): at
com.cogknit.adhoc.client.Client.connect(Client.java:38)


Can anybody help me to rectify this problem. What could be the reason
for this time out. I need to get this done in couple of days. So
please help me asap.

Thanks,
Sanjay

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment