Is socket.shutdown(1) useless
mgarrana at mantrac.com.eg
Thu Jun 4 21:42:23 CEST 2009
This is is in answer for Is socket.shutdown(1) useless
Shutdown(1) , forces the socket no to send any more data
This is usefull in
Strange error detection
Let me explain more , when you send a data , it's not guaranteed to be
sent to your peer , it's only guaranteed to be sent to the os buffer ,
which in turn sends it to the peer os buffer
So by doing shutdown(1) , you flush your buffer and an error is raised
if the buffer is not empty ie: data has not been sent to the peer yet
Howoever this is irrevesable , so you can do that after you completely
sent all your data and you want to be sure that it's atleast at the peer
Everything's ok in the end...if it's not ok, then its not the end.
P save paper...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list