Changes between Version 8 and Version 9 of TwistedNames


Ignore:
Timestamp:
07/31/2013 02:01:33 PM (17 months ago)
Author:
exarkun
Comment:

The demonstrated usage is incorrect. Server addresses are tuples including a port nuber. Also, example.com is the canonical example domain.

Legend:

Unmodified
Added
Removed
Modified
  • TwistedNames

    v8 v9  
    3131$ python -m twisted.conch.stdio 
    3232>>> from twisted.names import client 
    33 >>> resolver = client.createResolver(servers=['8.8.8.8', '8.8.4.4'], hosts='alternate_hosts_file') 
    34 >>> resolver.getHostByName('twistedmatrix.com') 
    35 <Deferred at 0x9dcfbac current result: '1.2.3.4'> 
     33>>> resolver = client.createResolver(servers=[('8.8.8.8', 53), ('8.8.4.4', 53)], hosts='alternate_hosts_file') 
     34>>> resolver.getHostByName('example.com') 
     35<Deferred at 0x9dcfbac current result: '93.184.216.119'> 
    3636}}} 
    3737 
     
    4242from twisted.internet import reactor 
    4343from twisted.names import client 
    44 reactor.installResolver(client.createResolver(servers=['8.8.8.8', '8.8.4.4'], hosts='alternate_hosts_file')) 
     44reactor.installResolver(client.createResolver(servers=[('8.8.8.8', 53), ('8.8.4.4', 53)], hosts='alternate_hosts_file')) 
    4545}}} 
    4646