views:

130

answers:

1

Hi,

When a TCP application exits it will send a FIN packet.

Consider a tcp client which get connected to a always listening server(server never exits).

if the tcp client is exiting abruptly after few exchange of packets, will it always send a FIN packet to the server?

Thx!

+2  A: 

Under normal operation , a FIN will be sent ,yes.

Here's a few cases where a FIN is not going to be sent.

  • Someone yanks out the network cable of the client.
  • The client gets nuked
  • The FIN packets are dropped on the way.
  • The OS on the kernel crashes hard.
nos
I think close call is necessary to send a FIN correct?Even if the client does not call close call, wil it be sent?
kumar
Yes, even if the application does not close the connection the OS will do it for you when/after the application exits, and a FIN will be sent,(or a RST depending on the connection state, e.g. if there's unprocessed incoming data )
nos