Saturday, December 3, 2011

RE: [android-developers] Malfunction of socket's connection in 3G mode (not in WiFi)

No one can help me?

-----Message d'origine-----
De : android-developers@googlegroups.com
[mailto:android-developers@googlegroups.com] De la part de Athar
Envoyé : mercredi 30 novembre 2011 17:10
À : Android Developers
Objet : [android-developers] Malfunction of socket's connection in 3G mode
(not in WiFi)

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 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

--
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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate