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

def paramiko::channel::Channel::send_stderr (   self,
  s 
)

Send data to the channel on the "stderr" stream.  This is normally
only used by servers to send output from shell commands -- clients
won't use this.  Returns the number of bytes sent, or 0 if the channel
stream is closed.  Applications are responsible for checking that all
data has been sent: if only some of the data was transmitted, the
application needs to attempt delivery of the remaining data.

@param s: data to send.
@type s: str
@return: number of bytes actually sent.
@rtype: int

@raise socket.timeout: if no data could be sent before the timeout set
    by L{settimeout}.

@since: 1.1

Definition at line 661 of file channel.py.

00661                             :
        """
        Send data to the channel on the "stderr" stream.  This is normally
        only used by servers to send output from shell commands -- clients
        won't use this.  Returns the number of bytes sent, or 0 if the channel
        stream is closed.  Applications are responsible for checking that all
        data has been sent: if only some of the data was transmitted, the
        application needs to attempt delivery of the remaining data.
        
        @param s: data to send.
        @type s: str
        @return: number of bytes actually sent.
        @rtype: int
        
        @raise socket.timeout: if no data could be sent before the timeout set
            by L{settimeout}.
        
        @since: 1.1
        """
        size = len(s)
        self.lock.acquire()
        try:
            size = self._wait_for_send_window(size)
            if size == 0:
                # eof or similar
                return 0
            m = Message()
            m.add_byte(chr(MSG_CHANNEL_EXTENDED_DATA))
            m.add_int(self.remote_chanid)
            m.add_int(1)
            m.add_string(s[:size])
            self.transport._send_user_message(m)
        finally:
            self.lock.release()
        return size

    def sendall(self, s):


Generated by  Doxygen 1.6.0   Back to index