관리-도구
편집 파일: network.cpython-38.pyc
U )�e�J � @ s� d Z ddlmZ ddlZddlZddlZddlZzddlZW n Y nX ddlm Z m Z ddlmZm Z mZ dd� Zd d � ZG dd� de�ZG d d� de�ZG dd� de�ZdS )zGModule implementing low-level socket communication with MySQL servers. � )�dequeN� )� constants�errors)�PY2�init_bytearray� struct_unpackc C s | j st| �S dj| j | jd�S )z_Reformat the IOError error message This function reformats the IOError error message. z{errno} {strerr})�errnoZstrerr)r �str�format�strerror)�err� r �l/opt/hc_python/lib64/python3.8/site-packages/../../../lib/python3.8/site-packages/mysql/connector/network.py�_strioerror+ s r c C s� g }t | �}tj}||krZ|�dt�d|� | d|� � | |d� } t | �}|d }q|�t�d|�dd� t�d|� | � |S )z0Prepare a packet for sending to the MySQL server� ����<BNr �<Ir � )�lenr �MAX_PACKET_LENGTH�append�struct�pack)�buf�pktnr�pkts�pllen� maxpktlenr r r �_prepare_packets5 s � ��r c @ s� e Zd ZdZdd� Zedd� �Zedd� �Zdd � Zd d� Z dd � Z dd� Zd%dd�ZeZ d&dd�Zdd� Zdd� Zejdd� dkr�eZeZneZdd� Zdd� Zd d!� Zd'd#d$�ZdS )(�BaseMySQLSocketa Base class for MySQL socket communication This class should not be used directly but overloaded, changing the at least the open_connection()-method. Examples of subclasses are mysql.connector.network.MySQLTCPSocket mysql.connector.network.MySQLUnixSocket c C s* d | _ d | _d| _d| _t� | _d| _d S )N���i )�sock�_connection_timeout�_packet_number�_compressed_packet_numberr � _packet_queueZrecvsize��selfr r r �__init__N s zBaseMySQLSocket.__init__c C s"