[Python-checkins] CVS: python/dist/src/Doc/lib libsocket.tex,1.43,1.44

Fred Drake python-dev@python.org
Wed, 3 May 2000 15:40:36 -0400


Update of /projects/cvsroot/python/dist/src/Doc/lib
In directory seahag.cnri.reston.va.us:/home/fdrake/projects/python/Doc/lib

Modified Files:
	libsocket.tex 
Log Message:

Someone found the examples of poor practice on socket addresses!
Spotted by Greg Kochanski <gpk@bell-labs.com>.


Index: libsocket.tex
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Doc/lib/libsocket.tex,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -r1.43 -r1.44
*** libsocket.tex	2000/04/04 17:48:30	1.43
--- libsocket.tex	2000/05/03 19:40:32	1.44
***************
*** 414,418 ****
  PORT = 50007              # Arbitrary non-privileged server
  s = socket(AF_INET, SOCK_STREAM)
! s.bind(HOST, PORT)
  s.listen(1)
  conn, addr = s.accept()
--- 414,418 ----
  PORT = 50007              # Arbitrary non-privileged server
  s = socket(AF_INET, SOCK_STREAM)
! s.bind((HOST, PORT))
  s.listen(1)
  conn, addr = s.accept()
***************
*** 431,435 ****
  PORT = 50007              # The same port as used by the server
  s = socket(AF_INET, SOCK_STREAM)
! s.connect(HOST, PORT)
  s.send('Hello, world')
  data = s.recv(1024)
--- 431,435 ----
  PORT = 50007              # The same port as used by the server
  s = socket(AF_INET, SOCK_STREAM)
! s.connect((HOST, PORT))
  s.send('Hello, world')
  data = s.recv(1024)
***************
*** 439,442 ****
  
  \begin{seealso}
! \seemodule{SocketServer}{classes that simplify writing network servers}
  \end{seealso}
--- 439,442 ----
  
  \begin{seealso}
!   \seemodule{SocketServer}{classes that simplify writing network servers}
  \end{seealso}