def handle_events(self, events):
        for sock, fd, event in events:
            if sock == self._listen_sock:
                self._handle_conn(sock)
            elif sock in self._local_to_remote:
                self._handle_local(sock, event)
            elif sock in self._remote_to_local:
                self._handle_remote(sock, event)
        # TODO implement timeout
dataset/ETHPy150Open shadowsocks/ShadowDNS/shadowdns/dnsrelay.py/TCPDNSRelay.handle_events/original