I'm trying to listen on a port using ServerSocket on an Android
device. I want to be able to connect to this port over WiFi using a
computer on the same network.

I get no exception when binding it to a port, however when I check
netstat it says:

Proto Recv-Q Send-Q Local Address           Foreign Address
State
tcp        0      0 (null):4040             (null):*
LISTEN

I've tried countless ways of binding it to localhost, 0.0.0.0, the
WiFi LAN IP address of the device with SocketInetAddress and
InetAddress.getByName. Nothing seems to work.

When I try to connect to the port from a computer in the same WiFi
(I've tried both netcat and Java's Socket.connect()), all I can see in
Wireshark is an ARP request:

Who has [phone's LAN address]? Tell [computer LAN address].

This request repeat itself until timed out.

I've tried the reverse way, by setting the ServerSocket on the
computer and connecting to that port from the phone, that works very
well.

My testing phone is an Samsung Spica i5700 with a custom ROM.

Any ideas?

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

Reply via email to