Shutdown socket before closing.

This commit is contained in:
Lance Stout 2011-08-25 13:48:43 -07:00
parent 4c08c9c524
commit d929e0deb2

View file

@ -485,9 +485,9 @@ class XMLStream(object):
if not self.auto_reconnect: if not self.auto_reconnect:
self.stop.set() self.stop.set()
try: try:
self.socket.shutdown(Socket.SHUT_RDWR)
self.socket.close() self.socket.close()
self.filesocket.close() self.filesocket.close()
self.socket.shutdown(Socket.SHUT_RDWR)
except Socket.error as serr: except Socket.error as serr:
self.event('socket_error', serr) self.event('socket_error', serr)
finally: finally: