Home | Trees | Indices | Help |
---|
|
object --+ | threading._Verbose --+ | threading.Thread --+ | SubsystemHandler
Handler for a subsytem in server mode. If you create a subclass of this class and pass it to `.Transport.set_subsystem_handler`, an object of this class will be created for each request for this subsystem. Each new object will be executed within its own new thread by calling `start_subsystem`. When that method completes, the channel is closed.
For example, if you made a subclass ``MP3Handler`` and registered it as the handler for subsystem ``"mp3"``, then whenever a client has successfully authenticated and requests subsytem ``"mp3"``, an object of class ``MP3Handler`` will be created, and `start_subsystem` will be called on it from a new thread.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
Properties | |
Inherited from Inherited from |
Method Details |
Create a new handler for a channel. This is used by `.ServerInterface` to start up a new handler when a channel requests this subsystem. You don't need to override this method, but if you do, be sure to pass the ``channel`` and ``name`` parameters through to the original ``__init__`` method here. :param .Channel channel: the channel associated with this subsystem request. :param str name: name of the requested subsystem. :param .ServerInterface server: the server object for the session that started this subsystem
|
Process an ssh subsystem in server mode. This method is called on a new object (and in a new thread) for each subsystem request. It is assumed that all subsystem logic will take place here, and when the subsystem is finished, this method will return. After this method returns, the channel is closed. The combination of ``transport`` and ``channel`` are unique; this handler corresponds to exactly one `.Channel` on one `.Transport`. .. note: It is the responsibility of this method to exit if the underlying `.Transport` is closed. This can be done by checking `.Transport.is_active` or noticing an EOF on the `.Channel`. If this method loops forever without checking for this case, your Python interpreter may refuse to exit because this thread will still be running. :param str name: name of the requested subsystem. :param .Transport transport: the server-mode `.Transport`. :param .Channel channel: the channel associated with this subsystem request. |
Perform any cleanup at the end of a subsystem. The default implementation just closes the channel. .. versionadded:: 1.1 |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu May 7 11:49:48 2015 | http://epydoc.sourceforge.net |