Foundations of Python Network Programming
Chapter 3 ■ tCp 54 Since you are not allowed to create unidirectional sockets through a standard socket() call, many programmers ...
Chapter 3 ■ tCp 55 Data is actually sent and received with send() and recv(). Some protocols running on top of TCP will mark up ...
57 Chapter 4 Socket Names and DNS Having spent the previous two chapters learning the basics of UDP and TCP, the two major data ...
Chapter 4 ■ SoCket NameS aNd dNS 58 You will recall that socket names are important at several points in the creation and use of ...
Chapter 4 ■ SoCket NameS aNd dNS 59 recognize, like AppleTalk and Bluetooth. Especially popular on POSIX systems is the AF_UNIX ...
Chapter 4 ■ SoCket NameS aNd dNS 60 The differences that IPv6 will make for your Python code might sound quite daunting if liste ...
Chapter 4 ■ SoCket NameS aNd dNS 61 The variable named info here contains everything you need to create a socket and use it to m ...
Chapter 4 ■ SoCket NameS aNd dNS 62 You can see that supplying the IPv4 address for the local host locks you down to receiving c ...
Chapter 4 ■ SoCket NameS aNd dNS 63 This can be useful if you are not going to try to use the addresses yourself but if you are ...
Chapter 4 ■ SoCket NameS aNd dNS 64 Other getaddrinfo() Flags The examples just given demonstrate the operation of three of the ...
Chapter 4 ■ SoCket NameS aNd dNS 65 Primitive Name Service Routines Before getaddrinfo() was all the rage, programmers doing soc ...
Chapter 4 ■ SoCket NameS aNd dNS 66 import argparse, socket, sys def connect_to(hostname_or_ip): try: infolist = socket.getaddri ...
Chapter 4 ■ SoCket NameS aNd dNS 67 • You have not given the socket() constructor a list of three separate items. Instead, th ...
Chapter 4 ■ SoCket NameS aNd dNS 68 to DNS. On my Ubuntu laptop, for example, the /etc/hosts file is checked first on every sing ...
Chapter 4 ■ SoCket NameS aNd dNS 69 Depending on how python.org has its name servers configured, the DNS server might require ju ...
Chapter 4 ■ SoCket NameS aNd dNS 70 Thus, let’s take a look at one of the third-party DNS libraries for Python as we bring this ...
Chapter 4 ■ SoCket NameS aNd dNS 71 • The “type” of record. Some common ones are A for an IPv4 address, AAAA for an IPv6 addr ...
Chapter 4 ■ SoCket NameS aNd dNS 72 if answer.rrset is not None: for record in answer: print(indent, hostname, 'has AAAA address ...
Chapter 4 ■ SoCket NameS aNd dNS 73 Whether that IP belongs to one machine or is shared by a cluster of hosts, is, of course, so ...
75 Chapter 5 Network Data and Network Errors The first four chapters of this book showed how hosts are named on an IP network an ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf