def _handle_local(self, local, event):
        remote = self._local_to_remote[local]
        encryptor = self._local_to_encryptor.get(local, None)
        if event & eventloop.POLL_ERR:
            self._destroy(local, remote)
        elif event & eventloop.POLL_IN:
            try:
                data = local.recv(BUF_SIZE)
                if not data:
                    self._destroy(local, remote)
                else:
                    if not encryptor:
                        try:
                            req = asyncdns.parse_response(data[2:])
                            if req:
                                logging.info('request %s', req.hostname)
                        except Exception as e:
                            logging.error(e)
                        encryptor = \
                            encrypt.Encryptor(self._config['password'],
                                              self._config['method'])
                        self._local_to_encryptor[local] = encryptor
                        data = self._address_to_send + data
                    data = encryptor.encrypt(data)
                    remote.send(data)
            except (OSError, __HOLE__) as e:
                self._destroy(local, self._local_to_remote[local])
                logging.error(e)
dataset/ETHPy150Open shadowsocks/ShadowDNS/shadowdns/dnsrelay.py/TCPDNSRelay._handle_local