Known subclasses: twisted.conch.client.agent.SSHAgentForwardingChannel, twisted.conch.endpoints._CommandChannel, twisted.conch.scripts.cftp.SSHSession, twisted.conch.scripts.conch.SSHSession, twisted.conch.scripts.tkconch.SSHSession, twisted.conch.ssh.forwarding.SSHConnectForwardingChannel, twisted.conch.ssh.forwarding.SSHListenForwardingChannel, twisted.conch.ssh.session.SSHSession

Implements interfaces: twisted.internet.interfaces.ITransport

A class that represents a multiplexed channel over an SSH connection. The channel has a local window which is the maximum amount of data it will receive, and a remote which is the maximum amount of data the remote side will accept. There is also a maximum packet size for any individual data packet going each way.

Instance Variable name the name of the channel. (type: bytes)
Instance Variable localWindowSize the maximum size of the local window in bytes. (type: int)
Instance Variable localWindowLeft how many bytes are left in the local window. (type: int)
Instance Variable localMaxPacket the maximum size of packet we will accept in bytes. (type: int)
Instance Variable remoteWindowLeft how many bytes are left in the remote window. (type: int)
Instance Variable remoteMaxPacket the maximum size of a packet the remote side will accept in bytes. (type: int)
Instance Variable conn the connection this channel is multiplexed through. (type: SSHConnection)
Instance Variable data any data to send to the other side when the channel is requested. (type: bytes)
Instance Variable avatar an avatar for the logged-in user (if a server channel)
Instance Variable localClosed True if we aren't accepting more data. (type: bool)
Instance Variable remoteClosed True if the other side isn't accepting more data. (type: bool)
Method __init__ Undocumented
Method __str__ Undocumented
Method __bytes__ Return a byte string representation of the channel
Method logPrefix Override this method to insert custom logging behavior. Its return value will be inserted in front of every line. It may be called more times than the number of output lines.
Method channelOpen Called when the channel is opened. specificData is any data that the other side sent us when opening the channel.
Method openFailed Called when the open failed for some reason. reason.desc is a string descrption, reason.code the SSH error code.
Method addWindowBytes Called when bytes are added to the remote window. By default it clears the data buffers.
Method requestReceived No summary
Method dataReceived Called when we receive data.
Method extReceived Called when we receive extended data (usually standard error).
Method eofReceived Called when the other side will send no more data.
Method closeReceived Called when the other side has closed the channel.
Method closed Called when the channel is closed. This means that both our side and the remote side have closed the channel.
Method write Write some data to the channel. If there is not enough remote window available, buffer until it is. Otherwise, split the data into packets of length remoteMaxPacket and send them.
Method writeExtended Send extended data to this channel. If there is not enough remote window available, buffer until there is. Otherwise, split the data into packets of length remoteMaxPacket and send them.
Method writeSequence Part of the Transport interface. Write a list of strings to the channel.
Method loseConnection Close the channel if there is no buferred data. Otherwise, note the request and return.
Method getPeer See: ITransport.getPeer
Method getHost See: ITransport.getHost
Method stopWriting Called when the remote buffer is full, as a hint to stop writing. This can be ignored, but it can be helpful.
Method startWriting Called when the remote buffer has more room, as a hint to continue writing.
name =
the name of the channel. (type: bytes)
localWindowSize =
the maximum size of the local window in bytes. (type: int)
localWindowLeft =
how many bytes are left in the local window. (type: int)
localMaxPacket =
the maximum size of packet we will accept in bytes. (type: int)
remoteWindowLeft =
how many bytes are left in the remote window. (type: int)
remoteMaxPacket =
the maximum size of a packet the remote side will accept in bytes. (type: int)
conn =
the connection this channel is multiplexed through. (type: SSHConnection)
data =
any data to send to the other side when the channel is requested. (type: bytes)
avatar =
an avatar for the logged-in user (if a server channel)
localClosed =
True if we aren't accepting more data. (type: bool)
remoteClosed =
True if the other side isn't accepting more data. (type: bool)
def __init__(self, localWindow=0, localMaxPacket=0, remoteWindow=0, remoteMaxPacket=0, conn=None, data=None, avatar=None): (source)
def __str__(self): (source)
Undocumented
def __bytes__(self): (source)

Return a byte string representation of the channel

def logPrefix(self): (source)

Override this method to insert custom logging behavior. Its return value will be inserted in front of every line. It may be called more times than the number of output lines.

def openFailed(self, reason): (source)

Called when the open failed for some reason. reason.desc is a string descrption, reason.code the SSH error code.

def addWindowBytes(self, data): (source)

Called when bytes are added to the remote window. By default it clears the data buffers.

def requestReceived(self, requestType, data): (source)

Called when a request is sent to this channel. By default it delegates to self.request_<requestType>. If this function returns true, the request succeeded, otherwise it failed.

Returns (type: bool)
def extReceived(self, dataType, data): (source)
def closeReceived(self): (source)

Called when the other side has closed the channel.

def write(self, data): (source)

Write some data to the channel. If there is not enough remote window available, buffer until it is. Otherwise, split the data into packets of length remoteMaxPacket and send them.

def writeExtended(self, dataType, data): (source)

Send extended data to this channel. If there is not enough remote window available, buffer until there is. Otherwise, split the data into packets of length remoteMaxPacket and send them.

def writeSequence(self, data): (source)

Part of the Transport interface. Write a list of strings to the channel.

def loseConnection(self): (source)

Close the channel if there is no buferred data. Otherwise, note the request and return.

def getPeer(self): (source)

See: ITransport.getPeer

ReturnsThe remote address of this connection. (type: SSHTransportAddress.)
def getHost(self): (source)

See: ITransport.getHost

ReturnsAn address describing this side of the connection. (type: SSHTransportAddress.)
def stopWriting(self): (source)

Called when the remote buffer is full, as a hint to stop writing. This can be ignored, but it can be helpful.

def startWriting(self): (source)

Called when the remote buffer has more room, as a hint to continue writing.

API Documentation for Twisted, generated by pydoctor at 2018-10-15 19:29:43.