def _handle_remote(self, remote, event):
        local = self._remote_to_local[remote]
        if event & eventloop.POLL_ERR:
            self._destroy(local, remote)
        elif event & eventloop.POLL_OUT:
            self._loop.modify(remote, eventloop.POLL_IN)
            self._loop.modify(local, eventloop.POLL_IN)
        elif event & eventloop.POLL_IN:
            try:
                data = remote.recv(BUF_SIZE)
                if not data:
                    self._destroy(local, remote)
                else:
                    encryptor = self._local_to_encryptor[local]
                    data = encryptor.decrypt(data)
                    try:
                        res = asyncdns.parse_response(data[2:])
                        if res:
                            logging.info('response %s', res)
                    except Exception as e:
                        logging.error(e)
                    local.send(data)
            except (OSError, __HOLE__) as e:
                self._destroy(local, remote)
                logging.error(e)
dataset/ETHPy150Open shadowsocks/ShadowDNS/shadowdns/dnsrelay.py/TCPDNSRelay._handle_remote