def recv(self, max_bytes):
        """Reads data from the socket.

        This test object will return the next bytes that were added to this object using
        the add_input method.  If not enough bytes are available, then will raise a timeout.
        If the socket is closed, then returns None.

        @param max_bytes: The maximum number of bytes to return.
        """
        result = self.__stream.read(max_bytes)
        if len(result) == 0:
            if self.__is_closed:
                return None
            else:
                raise socket.timeout()
        return result
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/monitor_utils/tests/server_processors_test.py/FakeSocket.recv/original