[EMAIL PROTECTED] wrote:
In my python books I find exclusive use of socket.close(). From my
other readings, I know about a "partial close operation". So, I figured
it would be useful to post some code about how socket.close() has an
implicit send in it and you can actually gain some clarity by being
more explicit with the partial close which means  splitting
socket.close() up into socket.shutdown(1) and socket.close().

And got a response in essence saying, why bother, socket.shutdown,
isn't useful.

I had to use socket.shutdown once because the socket architecture we had relied on sending a piece of data, waiting for it to be processed, and then receiving a result back. The server on the other end of the socket wouldn't process anything until it was sure that all data had been sent. So our code basically looked like:


s = socket.socket(...)
s.connect(...)
s.send(...)
s.shutdown(1)
data = s.makefile().read()
s.close()

STeVe
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to