Exemple #1
0
class PantsStream(object):
    def __init__(self, socket):
        self._stream = Stream(socket=socket)
        self._stream._handle_connect_event()

    def write(self, data):
        self._stream.write(data)

    def read(self, size, callback):
        self._stream.on_read = callback
        self._stream.read_delimiter = size

    def set_close_callback(self, callback):
        self._stream.on_close = callback

    def close(self):
        del self._stream.on_read
        del self._stream.on_close
        self._stream.close()
Exemple #2
0
    def __init__(self, **kwargs):
        Stream.__init__(self, **kwargs)

        # Initialize Stuff
        self._telnet_data = ""
Exemple #3
0
    def __init__(self, **kwargs):
        Stream.__init__(self, **kwargs)

        # Initialize Stuff
        self._telnet_data = ""
Exemple #4
0
 def __init__(self, socket):
     self._stream = Stream(socket=socket)
     self._stream._handle_connect_event()