diff --git a/instruments/abstract_instruments/comm/socket_communicator.py b/instruments/abstract_instruments/comm/socket_communicator.py index 2d68beab0..aefdd5878 100644 --- a/instruments/abstract_instruments/comm/socket_communicator.py +++ b/instruments/abstract_instruments/comm/socket_communicator.py @@ -91,7 +91,7 @@ def close(self): Shutdown and close the `socket.socket` connection. """ try: - self._conn.shutdown() + self._conn.shutdown(socket.SHUT_RDWR) finally: self._conn.close() diff --git a/instruments/tests/test_comm/test_socket.py b/instruments/tests/test_comm/test_socket.py index 59b943d4a..aee17e5c5 100644 --- a/instruments/tests/test_comm/test_socket.py +++ b/instruments/tests/test_comm/test_socket.py @@ -88,7 +88,7 @@ def test_socketcomm_close(): comm._conn = mock.MagicMock() comm.close() - comm._conn.shutdown.assert_called_with() + comm._conn.shutdown.assert_called_with(socket.SHUT_RDWR) comm._conn.close.assert_called_with()