File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -413,7 +413,7 @@ \subsection{Example}
413413HOST = '' # Symbolic name meaning the local host
414414PORT = 50007 # Arbitrary non-privileged server
415415s = socket(AF_INET, SOCK_STREAM)
416- s.bind(HOST, PORT)
416+ s.bind(( HOST, PORT) )
417417s.listen(1)
418418conn, addr = s.accept()
419419print 'Connected by', addr
@@ -430,13 +430,13 @@ \subsection{Example}
430430HOST = 'daring.cwi.nl' # The remote host
431431PORT = 50007 # The same port as used by the server
432432s = socket(AF_INET, SOCK_STREAM)
433- s.connect(HOST, PORT)
433+ s.connect(( HOST, PORT) )
434434s.send('Hello, world')
435435data = s.recv(1024)
436436s.close()
437437print 'Received', `data`
438438\end {verbatim }
439439
440440\begin {seealso }
441- \seemodule {SocketServer}{classes that simplify writing network servers}
441+ \seemodule {SocketServer}{classes that simplify writing network servers}
442442\end {seealso }
You can’t perform that action at this time.
0 commit comments