I'm still new to the whole twisted way of doing things, but it sounds very sensible. :) <br><br>Could you suggest a class to start studying from ?<br><br>/tax<br><br><div class="gmail_quote">2009/10/22 <span dir="ltr"><<a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On 07:00 pm, <a href="mailto:jesper@taxboel.dk">jesper@taxboel.dk</a> wrote:<br>
>Hi Jean-Paul,<br>
><br>
</div><div class="im">>I guess my focus is right when it comes to redirecting clients.<br>
><br>
>Im hooking into<br>
><br>
>DNSDatagramProtocol.writeMessage(self, message, address):<br>
><br>
>And I guess thats OK?<br>
<br>
</div>Depends what "OK" is supposed to mean.<br>
<div class="im">><br>
>But when it comes to bogus domains, I guess i could use:<br>
><br>
>DNSServerFactory.gotResolverError(self, failure, protocol, message,<br>
>address):<br>
<br>
</div>I don't know why you should have to do that.<br>
<div class="im">>My problem is now how I construct a redirect package and channel it<br>
>back to<br>
>the client.<br>
><br>
>Do you think that is a sensible approach? -and do you hava a pointer on<br>
>how<br>
>to find the associated client.<br>
<br>
</div>It would probably be a lot easier and more robust to implement a<br>
completely new custom resolver that *wraps* an existing resolver, rather<br>
than trying to extend an existing resolver via a subclass. This removes<br>
many irrelevant implementation details from consideration (such as<br>
writeMessage and gotResolverError) and gives you an obvious place to put<br>
your redirect logic - in an errback on the Deferred returned by one of<br>
the wrapped resolver's lookup/query methods.<br>
<div><div></div><div class="h5"><br>
Jean-Paul<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</div></div></blockquote></div><br>