Commit c319b065 authored by Julien Muchembled's avatar Julien Muchembled

Remove useless socket shutdown on close

shutdown is implicit because we don't duplicate sockets.
parent 19745e7c
......@@ -275,7 +275,6 @@ class BaseConnection(object):
em.removeReader(self)
em.removeWriter(self)
em.unregister(self)
self.connector.shutdown()
self.connector.close()
self.connector = None
self.aborted = False
......
......@@ -105,13 +105,6 @@ class SocketConnector:
raise ConnectorException, 'getNewConnection failed: %s:%s' % \
(err, errmsg)
def shutdown(self):
# This may fail if the socket is not connected.
try:
self.socket.shutdown(socket.SHUT_RDWR)
except socket.error:
pass
def receive(self):
try:
return self.socket.recv(4096)
......
......@@ -79,9 +79,6 @@ class ConnectionTests(NeoUnitTestBase):
def _checkWriterRemoved(self, n=1):
self.assertEqual(len(self.em.mockGetNamedCalls("removeWriter")), n)
def _checkShutdown(self, n=1):
self.assertEqual(len(self.connector.mockGetNamedCalls("shutdown")), n)
def _checkClose(self, n=1):
self.assertEqual(len(self.connector.mockGetNamedCalls("close")), n)
......@@ -523,7 +520,6 @@ class ConnectionTests(NeoUnitTestBase):
self.assertTrue(bc.pending())
self._checkWriterRemoved(0)
self._checkReaderRemoved(0)
self._checkShutdown(0)
self._checkClose(0)
finally:
del DoNothingConnector.send
......@@ -550,7 +546,6 @@ class ConnectionTests(NeoUnitTestBase):
self.assertFalse(bc.pending())
self._checkWriterRemoved(1)
self._checkReaderRemoved(0)
self._checkShutdown(0)
self._checkClose(0)
finally:
del DoNothingConnector.send
......@@ -578,7 +573,6 @@ class ConnectionTests(NeoUnitTestBase):
self.assertFalse(bc.pending())
self._checkWriterRemoved(1)
self._checkReaderRemoved(1)
self._checkShutdown(1)
self._checkClose(1)
finally:
del DoNothingConnector.send
......@@ -610,7 +604,6 @@ class ConnectionTests(NeoUnitTestBase):
self._checkUnregistered(0)
self._checkWriterRemoved(0)
self._checkReaderRemoved(0)
self._checkShutdown(0)
self._checkClose(0)
finally:
del DoNothingConnector.receive
......@@ -710,7 +703,6 @@ class ConnectionTests(NeoUnitTestBase):
self._checkReaderAdded(1)
self._checkWriterRemoved(1)
self._checkReaderRemoved(0)
self._checkShutdown(0)
self._checkClose(0)
finally:
del DoNothingConnector.send
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment