\begin{funcdesc}{listen}{backlog}
Listen for connections made to the socket.
-The argument (in the range 0-5) specifies the maximum number of
-queued connections.
+The argument specifies the maximum number of queued connections and
+should be at least 1; the maximum value is system-dependent.
\end{funcdesc}
\begin{funcdesc}{makefile}{mode}
PORT = 50007 # Arbitrary non-privileged server
s = socket(AF_INET, SOCK_STREAM)
s.bind(HOST, PORT)
-s.listen(0)
+s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
\begin{funcdesc}{listen}{backlog}
Listen for connections made to the socket.
-The argument (in the range 0-5) specifies the maximum number of
-queued connections.
+The argument specifies the maximum number of queued connections and
+should be at least 1; the maximum value is system-dependent.
\end{funcdesc}
\begin{funcdesc}{makefile}{mode}
PORT = 50007 # Arbitrary non-privileged server
s = socket(AF_INET, SOCK_STREAM)
s.bind(HOST, PORT)
-s.listen(0)
+s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1: