diff options
author | Fred Drake <fdrake@acm.org> | 2000-05-03 19:40:32 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-05-03 19:40:32 (GMT) |
commit | 3d69c0e440ddb3f6fdcc54ba6acc700e4d0c9f99 (patch) | |
tree | aac056892b60c3bd79f83f971793f38d18c958fc /Doc | |
parent | 25871c001f55941fec83e7ce9832e5f45c69a8cf (diff) | |
download | cpython-3d69c0e440ddb3f6fdcc54ba6acc700e4d0c9f99.zip cpython-3d69c0e440ddb3f6fdcc54ba6acc700e4d0c9f99.tar.gz cpython-3d69c0e440ddb3f6fdcc54ba6acc700e4d0c9f99.tar.bz2 |
Someone found the examples of poor practice on socket addresses!
Spotted by Greg Kochanski <gpk@bell-labs.com>.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libsocket.tex | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/lib/libsocket.tex b/Doc/lib/libsocket.tex index c845615..5fe6b1a 100644 --- a/Doc/lib/libsocket.tex +++ b/Doc/lib/libsocket.tex @@ -413,7 +413,7 @@ from socket import * HOST = '' # Symbolic name meaning the local host PORT = 50007 # Arbitrary non-privileged server s = socket(AF_INET, SOCK_STREAM) -s.bind(HOST, PORT) +s.bind((HOST, PORT)) s.listen(1) conn, addr = s.accept() print 'Connected by', addr @@ -430,7 +430,7 @@ from socket import * HOST = 'daring.cwi.nl' # The remote host PORT = 50007 # The same port as used by the server s = socket(AF_INET, SOCK_STREAM) -s.connect(HOST, PORT) +s.connect((HOST, PORT)) s.send('Hello, world') data = s.recv(1024) s.close() @@ -438,5 +438,5 @@ print 'Received', `data` \end{verbatim} \begin{seealso} -\seemodule{SocketServer}{classes that simplify writing network servers} + \seemodule{SocketServer}{classes that simplify writing network servers} \end{seealso} |