I am trying to connect to a remote host via the java program:
socket = new java.net.Socket(host,port);
I am getting the following exception:
java.net.ConnectException: Connection refused: connect
Tracing IP packets between my computer and the remote host, I see that my computer sent SYN packets three times, and received [RST,ACK] packets three times .
Why does my computer send three SYN packets despite only one connection establishent?
Is it due to the TCP/IP stack of the OS?
Or is it due to Java's implementation of java.net.Socket class?