Ask Your Question
0

Client is waiting for FIN flag from server for 30 sec

asked 2017-11-01 05:11:02 +0000

Nurlan gravatar image

updated 2017-11-01 05:11:38 +0000

When I initialize TCP connection and send data, my application (client) delays for 30 seconds. Via Wireshark I see that response body is already received (15,16 packets), however the app waits for FIN packet from server (17 packet).

Packets snapshot via wireshark: https://www.dropbox.com/s/il8zkik5w88...

How can I shrink the delay?

edit retag flag offensive close merge delete

Comments

@Nurlan: I have reopened the question again. As accepting the answer which solved the question is enough. Closing is not necessary.

Christian_R gravatar imageChristian_R ( 2017-11-02 14:01:23 +0000 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2017-11-01 07:44:56 +0000

Christian_R gravatar image

The answer is, it is application related. Normally the client initialized a session and he also ends a session. As he is the only one who knows, if he wants more data from the server or not. But in your case the client does not close the session. So the servers ends the session nicely by sending a fin packets after 30 seconds. So from my point of view, the question should be, why does the client not close the session itself.

edit flag offensive delete link more

Comments

I agree. This is probably caused by the application logic - the programmer should close the socket when everything is done, instead of letting it run into the time out.

Jasper gravatar imageJasper ( 2017-11-01 07:59:17 +0000 )edit

Thank you! The problem is application related indeed. Resolved it by changing from blocking socket implementation to non-blocking.

Nurlan gravatar imageNurlan ( 2017-11-02 04:08:50 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-11-01 05:11:02 +0000

Seen: 1,116 times

Last updated: Nov 01 '17