示例#1
0
    def handle_accepted(self, sock, addr):
        handler = _FTPServer.handle_accepted(self, sock, addr)
        if handler is not None:
            # unregister the handler from the main IOLoop used by the
            # main thread to accept connections
            self.ioloop.unregister(handler._fileno)

            t = self._start_task(target=self._loop, args=(handler,))
            t.name = repr(addr)
            t.start()

            self._lock.acquire()
            self._active_tasks.append(t)
            self._lock.release()
示例#2
0
    def handle_accepted(self, sock, addr):
        handler = _FTPServer.handle_accepted(self, sock, addr)
        if handler is not None:
            # unregister the handler from the main IOLoop used by the
            # main thread to accept connections
            self.ioloop.unregister(handler._fileno)

            t = self._start_task(target=self._loop, args=(handler, ))
            t.name = repr(addr)
            t.start()

            self._lock.acquire()
            self._active_tasks.append(t)
            self._lock.release()