2

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?

2

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.

  • I thought the terminated side could not actively send request but respond to the other side. What is the meaning of continue reading the data if the terminated side could not respond or process the request? – Isolet Chan Jan 21 '16 at 15:17
  • There is nothing preventing the server from processing a request which doesn't involve sending data to a connection which it thinks is closed. The server closed the connection so that it cannot send data into the connection, but the connection is (must be) open for listening until it receives an ACK from the client or times out from not receiving anything. – Ron Maupin Jan 21 '16 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.