Foundations of Python Network Programming
Chapter 1 ■ IntroduCtIon to ClIent-Server networkIng 13 Generally, traditional IP addresses can be read from left to right: the ...
Chapter 1 ■ IntroduCtIon to ClIent-Server networkIng 14 Of course, routing is only this simple at the edge of the Internet, wher ...
Chapter 1 ■ IntroduCtIon to ClIent-Server networkIng 15 Fragmentation is necessary because the Internet Protocol supports very l ...
Chapter 1 ■ IntroduCtIon to ClIent-Server networkIng 16 You can also find RFCs referenced on general resources such as Wikipedia ...
17 Chapter 2 UDP The previous chapter described modern network hardware as supporting the transmission of short messages called ...
Chapter 2 ■ UDp 18 Port Numbers The problem of distinguishing among many signals that are sharing the same channel is a general ...
Chapter 2 ■ UDp 19 • Manual configuration: For all of the situations that are not covered by the previous two cases, manual i ...
Chapter 2 ■ UDp 20 The underlying system calls for networking, on both Windows and POSIX systems (like Linux and Mac OS X), cent ...
Chapter 2 ■ UDp 21 if name == 'main': choices = {'client': client, 'server': server} parser = argparse.ArgumentParser(descriptio ...
Chapter 2 ■ UDp 22 So, my only option seemed to be a port from the reserved-but-not-well-known range above 1023. I glanced over ...
Chapter 2 ■ UDp 23 Promiscuous Clients and Unwelcome Replies The client program in Listing 2-1 is actually dangerous! If you rev ...
Chapter 2 ■ UDp 24 Note that the client is vulnerable to anyone who can address a UDP packet to it. This is not an instance wher ...
Chapter 2 ■ UDp 25 def client(hostname, port): sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) hostname = sys.argv[2] so ...
Chapter 2 ■ UDp 26 First, UDP’s unreliability means that the client has to perform its request inside a loop. It either has to b ...
Chapter 2 ■ UDp 27 However, often it will find that one or more of its requests never results in replies, and it will have to re ...
Chapter 2 ■ UDp 28 Of course, giving up makes sense only if your program is trying to perform some brief task and needs to produ ...
Chapter 2 ■ UDp 29 First, doing a connect() on a UDP socket does not send any information across the network or do anything to w ...
Chapter 2 ■ UDp 30 Binding to Interfaces So far, you have seen two possibilities for the IP address used in the bind() call that ...
Chapter 2 ■ UDp 31 Do you see what happened? Programs running locally are allowed to send requests that originate from any of th ...
Chapter 2 ■ UDp 32 One last warning is in order. Since the foregoing discussion indicated that binding your server to the interf ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf