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?
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().
how to send a TCP FIN using python sockets