diff options
Diffstat (limited to 'Doc/howto/sockets.rst')
-rw-r--r-- | Doc/howto/sockets.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Doc/howto/sockets.rst b/Doc/howto/sockets.rst index 2629d44..69130c4 100644 --- a/Doc/howto/sockets.rst +++ b/Doc/howto/sockets.rst @@ -1,5 +1,5 @@ **************************** - Socket Programming HOWTO + Socket Programming HOWTO **************************** :Author: Gordon McMillan @@ -62,7 +62,7 @@ your browser did something like the following:: #create an INET, STREAMing socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - #now connect to the web server on port 80 + #now connect to the web server on port 80 # - the normal http port s.connect(("www.mcmillan-inc.com", 80)) @@ -77,7 +77,7 @@ creates a "server socket". :: #create an INET, STREAMing socket serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) - #bind the socket to a public host, + #bind the socket to a public host, # and a well-known port serversocket.bind((socket.gethostname(), 80)) #become a server socket @@ -184,7 +184,7 @@ Assuming you don't want to end the connection, the simplest solution is a fixed length message:: class mysocket: - """demonstration class only + """demonstration class only - coded for clarity, not efficiency """ @@ -340,9 +340,9 @@ you'll have little trouble with it in C. :: ready_to_read, ready_to_write, in_error = \ select.select( - potential_readers, - potential_writers, - potential_errs, + potential_readers, + potential_writers, + potential_errs, timeout) You pass ``select`` three lists: the first contains all sockets that you might |