Logo Search packages:      
Sourcecode: paramiko version File versions  Download package

def paramiko::transport::Transport::global_request (   self,
  kind,
  data = None,
  wait = True 
)

Make a global request to the remote host.  These are normally
extensions to the SSH2 protocol.

@param kind: name of the request.
@type kind: str
@param data: an optional tuple containing additional data to attach
    to the request.
@type data: tuple
@param wait: C{True} if this method should not return until a response
    is received; C{False} otherwise.
@type wait: bool
@return: a L{Message} containing possible additional data if the
    request was successful (or an empty L{Message} if C{wait} was
    C{False}); C{None} if the request was denied.
@rtype: L{Message}

@since: fearow

Definition at line 710 of file transport.py.

00710                                                         :
        """
        Make a global request to the remote host.  These are normally
        extensions to the SSH2 protocol.

        @param kind: name of the request.
        @type kind: str
        @param data: an optional tuple containing additional data to attach
            to the request.
        @type data: tuple
        @param wait: C{True} if this method should not return until a response
            is received; C{False} otherwise.
        @type wait: bool
        @return: a L{Message} containing possible additional data if the
            request was successful (or an empty L{Message} if C{wait} was
            C{False}); C{None} if the request was denied.
        @rtype: L{Message}

        @since: fearow
        """
        if wait:
            self.completion_event = threading.Event()
        m = Message()
        m.add_byte(chr(MSG_GLOBAL_REQUEST))
        m.add_string(kind)
        m.add_boolean(wait)
        if data is not None:
            m.add(*data)
        self._log(DEBUG, 'Sending global request "%s"' % kind)
        self._send_user_message(m)
        if not wait:
            return None
        while True:
            self.completion_event.wait(0.1)
            if not self.active:
                return None
            if self.completion_event.isSet():
                break
        return self.global_response

    def accept(self, timeout=None):


Generated by  Doxygen 1.6.0   Back to index