I think we should have a ```self._wrappedsock.shutdown(socket.SHUT_RDWR)``` before the ```close``` call.