File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,9 +84,11 @@ creates a "server socket"::
8484 serversocket.listen(5)
8585
8686A couple things to notice: we used ``socket.gethostname() `` so that the socket
87- would be visible to the outside world. If we had used ``s.bind(('', 80)) `` or
88- ``s.bind(('localhost', 80)) `` or ``s.bind(('127.0.0.1', 80)) `` we would still
89- have a "server" socket, but one that was only visible within the same machine.
87+ would be visible to the outside world. If we had used ``s.bind(('localhost',
88+ 80)) `` or ``s.bind(('127.0.0.1', 80)) `` we would still have a "server" socket,
89+ but one that was only visible within the same machine. ``s.bind(('', 80)) ``
90+ specifies that the socket is reachable by any address the machine happens to
91+ have.
9092
9193A second thing to note: low number ports are usually reserved for "well known"
9294services (HTTP, SNMP etc). If you're playing around, use a nice high number (4
You can’t perform that action at this time.
0 commit comments