Python send eof

5 Python code examples are found related to " send eof". You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.
Example 1
Source File: connection.py    From Safejumper-for-Desktop with GNU General Public License v2.0 5 votes vote down vote up
def sendEOF(self, channel):
        """
        Send an EOF (End of File) for a channel.

        @type channel:  subclass of L{SSHChannel}
        """
        if channel.localClosed:
            return # we're already closed
        log.msg('sending eof')
        self.transport.sendPacket(MSG_CHANNEL_EOF, struct.pack('>L',
                                    self.channelsToRemoteChannel[channel])) 
Example 2
Source File: proctools.py    From pycopia with Apache License 2.0 5 votes vote down vote up
def send_eof(self):
        """Like pressing Ctl-D on most terminals."""
        if self._eof is None:
            from pycopia import tty
            self._eof = tty.get_eof_char(self._fd)
        self._write(self._eof) 
Example 3
Source File: connection.py    From BitTorrent with GNU General Public License v3.0 5 votes vote down vote up
def sendEOF(self, channel):
        """
        Send an EOF (End of File) for a channel.

        @type channel:  subclass of C{SSHChannel}
        """
        if channel.localClosed:
            return # we're already closed
        log.msg('sending eof')
        self.transport.sendPacket(MSG_CHANNEL_EOF, struct.pack('>L', 
                                    self.channelsToRemoteChannel[channel]))