diff Doc/lib/libsocket.tex @ 12571:8bcd14313c11 legacy-trunk

Someone found the examples of poor practice on socket addresses! Spotted by Greg Kochanski <gpk@bell-labs.com>.
author Fred Drake <fdrake@acm.org>
date Wed, 03 May 2000 19:40:32 +0000
parents 7bf8b10ce2ab
children d37374552a15
line wrap: on
line diff
--- a/Doc/lib/libsocket.tex	Wed May 03 15:17:02 2000 +0000
+++ b/Doc/lib/libsocket.tex	Wed May 03 19:40:32 2000 +0000
@@ -413,7 +413,7 @@
 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 @@
 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 @@
 \end{verbatim}
 
 \begin{seealso}
-\seemodule{SocketServer}{classes that simplify writing network servers}
+  \seemodule{SocketServer}{classes that simplify writing network servers}
 \end{seealso}