summaryrefslogtreecommitdiffstats
path: root/Demo/dns
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-09-14 16:44:15 (GMT)
committerGuido van Rossum <guido@python.org>1998-09-14 16:44:15 (GMT)
commit4117e5428bf1ff3d26d23bd77472265412473ad9 (patch)
treed3a38e1c85eb46e5299cec0d5fb358cdc1db28fe /Demo/dns
parentf9a6d7d49425a04b10e4373077230c6cb93c5817 (diff)
downloadcpython-4117e5428bf1ff3d26d23bd77472265412473ad9.zip
cpython-4117e5428bf1ff3d26d23bd77472265412473ad9.tar.gz
cpython-4117e5428bf1ff3d26d23bd77472265412473ad9.tar.bz2
nannified
Diffstat (limited to 'Demo/dns')
-rwxr-xr-xDemo/dns/asgethost.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/Demo/dns/asgethost.py b/Demo/dns/asgethost.py
index 9a90268..2e9185a 100755
--- a/Demo/dns/asgethost.py
+++ b/Demo/dns/asgethost.py
@@ -7,7 +7,7 @@ import socket
import select
def main():
- server = 'cnri.reston.va.us' # How?
+ server = 'cnri.reston.va.us' # How?
port = 53
opcode = dnsopcode.QUERY
rd = 0
@@ -15,21 +15,21 @@ def main():
qname = sys.argv[1:] and sys.argv[1] or 'www.python.org'
m = dnslib.Mpacker()
m.addHeader(0,
- 0, opcode, 0, 0, rd, 0, 0, 0,
- 1, 0, 0, 0)
+ 0, opcode, 0, 0, rd, 0, 0, 0,
+ 1, 0, 0, 0)
m.addQuestion(qname, qtype, dnsclass.IN)
request = m.getbuf()
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect((server, port))
s.send(request)
while 1:
- r, w, x = [s], [], []
- r, w, x = select.select(r, w, x, 0.333)
- print r, w, x
- if r:
- reply = s.recv(1024)
- u = dnslib.Munpacker(reply)
- dnslib.dumpM(u)
- break
+ r, w, x = [s], [], []
+ r, w, x = select.select(r, w, x, 0.333)
+ print r, w, x
+ if r:
+ reply = s.recv(1024)
+ u = dnslib.Munpacker(reply)
+ dnslib.dumpM(u)
+ break
main()