angelos.lib.net.subsystem¶
-
exception
angelos.lib.net.subsystem.BadMessage(reason, lang='en-US')¶ Bases:
asyncssh.misc.ErrorBad message.
-
class
angelos.lib.net.subsystem.ClientSubsystemHandler(loop, reader, writer)¶ Bases:
angelos.lib.net.subsystem.SubsytemHandlerAn subsystem client handler.
# Make a request async def something(self, do_this):
return await self._make_request(PKT_TYPE, String(do_this))
# Process an incoming response def _process_something(self, packet: SSHPacket) -> Any:
data = packet.get_string() packet.check_end() return data
-
exit()¶ Handle a request to close the session.
-
start()¶ Start an client.
-
wait_closed()¶ Wait for this session to close.
-
-
exception
angelos.lib.net.subsystem.Failure(reason, lang='en-US')¶ Bases:
asyncssh.misc.ErrorFailure.
-
exception
angelos.lib.net.subsystem.NoConnection(reason, lang='en-US')¶ Bases:
asyncssh.misc.ErrorNo connection.
-
exception
angelos.lib.net.subsystem.OpUnsupported(reason, lang='en-US')¶ Bases:
asyncssh.misc.ErrorOperation unsupported.
-
class
angelos.lib.net.subsystem.ServerSubsystemHandler(server, reader, writer)¶ Bases:
angelos.lib.net.subsystem.SubsytemHandlerA server session handler.
# Process an incoming SFTP open request async def _process_something(self, packet: SSHPacket):
data = packet.get_string() packet.check_end()
result = self._server.something(data)
- if inspect.isawaitable(result):
result = await result
handle = self._get_next_handle() return handle
-
run()¶ Run a server.
-
class
angelos.lib.net.subsystem.SubsystemClient(ioc, handler)¶ Bases:
angelos.lib.ioc.ContainerAwareClient.
@async_context_manager async def something(self, data):
pass
-
exit()¶ Exit the client session.
-
property
logger¶ A logger associated with this client
-
wait_closed()¶ Wait for this client session to close.
-
-
class
angelos.lib.net.subsystem.SubsystemServer(ioc, chan)¶ Bases:
angelos.lib.ioc.ContainerAwareSubsystem server.
# A server side operation. def something(self, data):
pass
-
property
channel¶ The channel associated with this server session.
-
property
connection¶ The channel associated with this server session.
-
property
env¶ The environment associated with this server session.
-
property
logger¶ A logger associated with this SFTP server
-
property
-
class
angelos.lib.net.subsystem.SubsytemHandler(reader, writer)¶ Bases:
asyncssh.packet.SSHPacketLoggerSession handler
-
property
logger¶ A logger associated with this SFTP handler
-
receive_packet() → asyncssh.packet.SSHPacket¶ Receive an SFTP packet
-
receive_packets()¶ Receive and process packets
-
send_packet(packet_type, packet_id, *args)¶ Send a packet
-
property
-
angelos.lib.net.subsystem.run_server()¶ Return a handler for a server session
-
angelos.lib.net.subsystem.start_client()¶ Start a client