How to Ignore Client’s TCP FIN and Keep TCP Connection

layer4protocol-theorytcptransport-protocol

My company has to provide support to a piece of equipment that closes the connection on every request.

The problem is that in the most critical workflow, it needs to make 2 requests. The consequence is a very long wait between the two requests establishing SSL connection. The problem is even worse when GPRS is used.

I was wondering whether there is any way to prevent connection interruption. By looking at wireshark dump, it feels like if I could ignore FIN, the connection would remain open. Does that make any sense?

What are my options?

Best Answer

Does that make any sense?

No.

The FIN is send because the sender decided that it wants to close the connection. Even if you would change the recipient that it will ignore the FIN the sender side of the application will still consider the connection closed and not send or receive any more data on it.

Just compare it to a phone call. If the other end decided to hang up the phone and no longer talk to you it does not matter if you are trying to ignore this, the other end still will not talk to you any more.

What are my options?

This must be fixed inside the application. For example the application could reuse the existing TCP connection like done with HTTP keep-alive.