TCP Protocol – Continue Using Connection After Receiving [FIN, ACK]

protocol-theorytcp

I see that some servers will stop the connection once a single request is done by sending [FIN, ACK]

From wiki,

A connection can be "half-open", in which case one side has terminated its end, but the other has not. The side that has terminated can no longer send any data into the connection, but the other side can. The terminating side should continue reading the data until the other side terminates as well.

In case I want to speed up the requests by avoiding repeating handshake per request. Is it possible for the client to keep communicating even the server terminated its end? Will there be any response from the server or the server just read my request without responding?

Update:

Just tested, if I delayed my [FIN, ACK] packet, there is no [ACK] packet from the server. Another question, if the server doesnt respond to it, will it process my request?

Best Answer

I think you are confused. Did you carefully read what you quoted? The side that terminates can keep receiving data, but it cannot send anything back into the connection.

That means that if the server terminates the connection, but the client does not, the client can send data to the server, but the server cannot send anything to the client. If the server needs to send anything back to the client to fulfill the request, it cannot.

There are reasons for the handshaking, and your desire to speed things up by eliminating the handshaking means that you are using the wrong transport protocol for what you want to do. It sounds like you want to use UDP instead of TCP. Any TCP features you wish to keep will need to be handled by the applications, but UDP eliminates all the handshaking.

Alternatively, you could create your own transport protocol.

Related Topic