Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 726
Pradeep Avatar asked Oct 22 '25 06:10

Pradeep


1 Answers

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().

like image 179
Ephemeral Avatar answered Oct 23 '25 19:10

Ephemeral



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!