def write_to_socket(self, frame_data):
        """Write data to the socket.

        :param str frame_data:
        :return:
        """
        total_bytes_written = 0
        bytes_to_send = len(frame_data)
        while bytes_to_send < total_bytes_written:
            try:
                bytes_written = \
                    self.socket.send(frame_data[total_bytes_written:])
                if bytes_written == 0:
                    raise socket.error('connection/socket error')
                total_bytes_written += bytes_written
            except socket.timeout:
                pass
            except socket.error as why:
                if why.args[0] == EWOULDBLOCK:
                    continue
                self._exceptions.append(AMQPConnectionError(why))
                break
        return total_bytes_written
dataset/ETHPy150Open eandersson/amqpstorm/amqpstorm/io.py/IO.write_to_socket/swapped operands of `<`