/var/opt/nydus/ops/mysql/connector/aio/__pycache__
Edit: /var/opt/nydus/ops/mysql/connector/aio/__pycache__/network.cpython-312.pyc (30596B)
Njo d Z ddgZddlZddlZddlZ ddlZej ej ej ej dZ
ddlm
Z
mZ ddlmZ ddlmZmZmZmZmZ d d
lmZmZmZmZmZmZ d dlmZm Z m!Z!m"Z" dd
l#m$Z$m%Z% de&de'fdZ( G d de
Z) G d de) Z* G d de* Z+ G d de
Z, G d de, Z- G d de, Z.y# e$ r dZY w xY w)zFModule implementing low-level socket communication with MySQL servers.MySQLTcpSocketMySQLUnixSocket N)TLSv1TLSv1.1TLSv1.2TLSv1.3)ABCabstractmethod)deque)AnyDequeListOptionalTuple )InterfaceErrorNotSupportedErrorOperationalErrorProgrammingErrorReadTimeoutErrorWriteTimeoutError)COMPRESSED_PACKET_HEADER_LENGTHMAX_PAYLOAD_LENGTHMIN_COMPRESS_LENGTHPACKET_HEADER_LENGTH )StreamWriteropen_connectionerrreturnc f | j st | S | j d| j S )z`Reformat the IOError error message.
This function reformats the IOError error message.
)errnostrstrerror)r s L/opt/nydus/tmp/pip-target-a90h98xg/lib/python/mysql/connector/aio/network.py_strioerrorr' I s,
993s8GSYYKq*GG c e Zd ZdZe ddedededee dee dee d dfd
Z
e ddej dedee d e
fd
Zy)
NetworkBrokeraP Broker class interface.
The network object is a broker used as a delegate by a socket object. Whenever the
socket wants to deliver or get packets to or from the MySQL server it needs to rely
on its network broker (netbroker).
The netbroker sends `payloads` and receives `packets`.
A packet is a bytes sequence, it has a header and body (referred to as payload).
The first `PACKET_HEADER_LENGTH` or `COMPRESSED_PACKET_HEADER_LENGTH`
(as appropriate) bytes correspond to the `header`, the remaining ones represent the
`payload`.
The maximum payload length allowed to be sent per packet to the server is
`MAX_PAYLOAD_LENGTH`. When `send` is called with a payload whose length is greater
than `MAX_PAYLOAD_LENGTH` the netbroker breaks it down into packets, so the caller
of `send` can provide payloads of arbitrary length.
Finally, data received by the netbroker comes directly from the server, expect to
get a packet for each call to `recv`. The received packet contains a header and
payload, the latter respecting `MAX_PAYLOAD_LENGTH`.
Nwriteraddresspayload
packet_numbercompressed_packet_number
write_timeoutr c K yw)a Send `payload` to the MySQL server.
If provided a payload whose length is greater than `MAX_PAYLOAD_LENGTH`, it is
broken down into packets.
Args:
sock: Object holding the socket connection.
address: Socket's location.
payload: Packet's body to send.
packet_number: Sequence id (packet ID) to attach to the header when sending
plain packets.
compressed_packet_number: Same as `packet_number` but used when sending
compressed packets.
write_timeout: Timeout in seconds before which sending a packet to the server
should finish else WriteTimeoutError is raised.
Raises:
:class:`OperationalError`: If something goes wrong while sending packets to
the MySQL server.
N )selfr+ r, r- r. r/ r0 s r&