Hi everyone,
If I'm here today, it's due to a "bug" (IMO) of Android Socket's
connection.
The problem is, if I try to initiate a Socket connection through the
3G, every port is seen "OK", even if the port is closed (I'm sure of
this).
In WiFi, no issue, the program work as expected (Socket TimeOut).
Tested version of Android:
2.3.3 (Sony Ericson Xperia 10) and 2.3.4 (Samsung Galaxy S)
Two different mobile operator, same issue.
So, the question is:
- Is this a bug with the 2.3.* rev of Android?
- Is there an another way to checked a port, without the socket? (I
don't see anything else. The purpose is to see if a port respond).
Best regards.
PS: I use that kind of code:
try {
SocketAddress sockaddr = new InetSocketAddress(IpAddress,DestPort);
Socket sock = new Socket();
sock.connect(sockaddr, 5000);
if (sock.isConnected()) {
Log.i("Appli1","Connection ok");
}
sock.close();
} catch (Exception e) {
Log.i("Appli1","Connection error");
e.printStackTrace();
}
--
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