Windows returns true for successful SocketChannel connect()
but it never returns false for a failed connection. It throws
java.net.SocketException: No such file or directory
when it cannot make the connection. This is the behavior in both
blocking and non-blocking mode. It should return false in non-blocking mode.
This has been observed in tests connecting to webservers or daytime
servers.
The attached test file, loops 2000 times to a daytime server, opening
a socket channel, connecting, then closing a socket channel. Compile the
test file and redirect the output to a file. Expected (normal) result
is that a portion of the connect calls will return false. They do on
Solaris but not on windows.
but it never returns false for a failed connection. It throws
java.net.SocketException: No such file or directory
when it cannot make the connection. This is the behavior in both
blocking and non-blocking mode. It should return false in non-blocking mode.
This has been observed in tests connecting to webservers or daytime
servers.
The attached test file, loops 2000 times to a daytime server, opening
a socket channel, connecting, then closing a socket channel. Compile the
test file and redirect the output to a file. Expected (normal) result
is that a portion of the connect calls will return false. They do on
Solaris but not on windows.