Pradeep
Pradeep

Reputation: 639

how to send a TCP FIN using python sockets

I was looking at how to send a TCP FIN using python socket.

I tried using the socket.socket.close and it sends out a TCP RST and not a TCP FIN. Can someone please let me know what is the API?

Upvotes: 4

Views: 4744

Answers (1)

Ephemeral
Ephemeral

Reputation: 423

From the python doc:

Note

close() releases the resource associated with a connection but does not necessarily close the connection immediately. If you want to close the connection in a timely fashion, call shutdown() before close().

Upvotes: 4

Related Questions