I don\'t understand why the following program doesn\'t work when the initial connect fails (I intentionally start the server socket after the first connect fails):
You can't reconnect a socket that has already failed to connect. You have to close it and try again with a new socket. The documentation you're looking for would be at the Berkeley Sockets API level, not Java,