Socket() returning false positive
843790Apr 7 2009 — edited May 27 2009I ran into this problem on Vista again I thought I solved it in previous thread [Thread 5369193|http://forums.sun.com/thread.jspa?forumID=536&threadID=5369193] but now when I use this test the Socket connection does not throw an exception for an IP address that does not exist it returns true for isConnected().
Socket testConnect;
connected = false;
try {
testConnect = new Socket();
SocketAddress addr = new InetSocketAddress(mjpgIPAddress, 80);
testConnect.connect(addr, 300);
Thread.sleep(300);
if (testConnect.isConnected()){ .......
Say I am trying to test the socket connection for an IP that doesn't exist the connection check returns true. It does this on my Vista x64 machine but not on my XP machine. Can anyone help cause it is really annoying?