diff --git a/src/gov/nist/javax/sip/stack/NIOHandler.java b/src/gov/nist/javax/sip/stack/NIOHandler.java index 110fb346c..48d1e8cb9 100644 --- a/src/gov/nist/javax/sip/stack/NIOHandler.java +++ b/src/gov/nist/javax/sip/stack/NIOHandler.java @@ -254,7 +254,6 @@ private SocketChannel openOutgoingConnection(InetAddress senderAddress, SocketChannel clientSock = null; boolean entered = false; - boolean connected = false; boolean attempted = false; try { keyedSemaphore.enterIOCriticalSection(key); @@ -368,7 +367,7 @@ private SocketChannel openOutgoingConnection(InetAddress senderAddress, } } finally { if (entered) { - if (attempted && !connected) + if (attempted && (clientSock!= null && clientSock.isBlocking() && !clientSock.isConnected())) { // new connection is bad. // remove from our table the socket and its semaphore