Ejemplo n.º 1
0
    def __init__(self, socket=None, addr=None, ssl_ctx=None, connect_cb=None,
            schedule=None):
        Dispatcher.__init__(self, socket)

        self.ssl_ctx = ssl_ctx
        self.connect_cb = connect_cb
        self.schedule = schedule
        self.collector = None
        self.new_collector = False
        self.started_locally = (addr is not None)
        self.want_write = False

        if self.started_locally:
            t = threading.Thread(target=self.connect, args=(addr,))
            t.start()
Ejemplo n.º 2
0
 def __init__(self, socket, getfunc):
     Dispatcher.__init__(self, socket)
     self.req = ''
     self.set_terminator('\n')
     self.getfunc = getfunc
     self.next_func = self.read_type