File: //usr/local/CyberCP/lib/python3.10/site-packages/asyncssh/__pycache__/session.cpython-310.pyc
o
�h\Y � @ s, d Z ddlmZmZmZmZmZ ddlmZmZm Z er.ddl
mZmZ ddl
m
Z
mZmZ ee ZG dd� dee �ZG d d
� d
ee �ZG dd� dee �ZG d
d� dee �ZG dd� dee �ZG dd� dee �Zeg ee f Zeg ee f Zeg ee f Zeg ee f Zeg ef ZdS )zSSH session handlers� )�
TYPE_CHECKING�Any�AnyStr�Callable�Generic)�Mapping�Optional�Tuple� )�SSHClientChannel�SSHServerChannel)�
SSHTCPChannel�SSHUNIXChannel�SSHTunTapChannelc @ sz e Zd ZdZdeddfdd�Zdee ddfdd �Zdd
d�Z de
d
eddfdd�Zde
fdd�Zddd�Zddd�ZdS )�
SSHSessionzSSH session handler�chan�returnNc C � dS )z,Called when a channel is opened successfullyN� ��selfr r r �C/usr/local/CyberCP/lib/python3.10/site-packages/asyncssh/session.py�connection_made( � zSSHSession.connection_made�excc C r )a� Called when a channel is closed
This method is called when a channel is closed. If the channel
is shut down cleanly, *exc* will be `None`. Otherwise, it
will be an exception explaining the reason for the channel close.
:param exc:
The exception which caused the channel to close, or
`None` if the channel closed cleanly.
:type exc: :class:`Exception`
Nr )r r r r r �connection_lost+ r zSSHSession.connection_lostc C r )a~ Called when the session is started
This method is called when a session has started up. For
client and server sessions, this will be called once a
shell, exec, or subsystem request has been successfully
completed. For TCP and UNIX domain socket sessions, it will
be called immediately after the connection is opened.
Nr �r r r r �session_started9 r zSSHSession.session_started�data�datatypec C r )aj Called when data is received on the channel
This method is called when data is received on the channel.
If an encoding was specified when the channel was created,
the data will be delivered as a string after decoding with
the requested encoding. Otherwise, the data will be delivered
as bytes.
:param data:
The data received on the channel
:param datatype:
The extended data type of the data, from :ref:`extended
data types <ExtendedDataTypes>`
:type data: `str` or `bytes`
Nr )r r r r r r �
data_receivedD r zSSHSession.data_receivedc C r )a� Called when EOF is received on the channel
This method is called when an end-of-file indication is received
on the channel, after which no more data will be received. If this
method returns `True`, the channel remains half open and data
may still be sent. Otherwise, the channel is automatically closed
after this method returns. This is the default behavior for
classes derived directly from :class:`SSHSession`, but not when
using the higher-level streams API. Because input is buffered
in that case, streaming sessions enable half-open channels to
allow applications to respond to input read after an end-of-file
indication is received.
Fr r r r r �eof_receivedV s zSSHSession.eof_receivedc C r )av Called when the write buffer becomes full
This method is called when the channel's write buffer becomes
full and no more data can be sent until the remote system
adjusts its window. While data can still be buffered locally,
applications may wish to stop producing new data until the
write buffer has drained.
Nr r r r r �
pause_writingh r zSSHSession.pause_writingc C r )z�Called when the write buffer has sufficiently drained
This method is called when the channel's send window reopens
and enough data has drained from the write buffer to allow the
application to produce more data.
Nr r r r r �resume_writings r zSSHSession.resume_writing�r N)�__name__�
__module__�__qualname__�__doc__r r r � Exceptionr r r �DataTyper �boolr! r"