summaryrefslogtreecommitdiffstats
path: root/Doc/lib
diff options
context:
space:
mode:
authorFacundo Batista <facundobatista@gmail.com>2007-03-29 18:22:35 (GMT)
committerFacundo Batista <facundobatista@gmail.com>2007-03-29 18:22:35 (GMT)
commitb6a5c9d605588e962f1cd242d2a52065f4c141db (patch)
treeb462b11e559d04c2eab3bc4e4332bcc77e6e218a /Doc/lib
parent30712ab82f7c545cfe89ddf56de135bfbf0ccb67 (diff)
downloadcpython-b6a5c9d605588e962f1cd242d2a52065f4c141db.zip
cpython-b6a5c9d605588e962f1cd242d2a52065f4c141db.tar.gz
cpython-b6a5c9d605588e962f1cd242d2a52065f4c141db.tar.bz2
Added timout parameter to telnetlib.Telnet. Also created
test_telnetlib.py with a basic test and timeout ones. Docs are also updated.
Diffstat (limited to 'Doc/lib')
-rw-r--r--Doc/lib/libtelnetlib.tex10
1 files changed, 8 insertions, 2 deletions
diff --git a/Doc/lib/libtelnetlib.tex b/Doc/lib/libtelnetlib.tex
index c7a4226..d236498 100644
--- a/Doc/lib/libtelnetlib.tex
+++ b/Doc/lib/libtelnetlib.tex
@@ -23,13 +23,16 @@ Mark), BRK (Break), IP (Interrupt process), AO (Abort output), AYT
SB (Subnegotiation Begin).
-\begin{classdesc}{Telnet}{\optional{host\optional{, port}}}
+\begin{classdesc}{Telnet}{\optional{host\optional{, port\optional{, timeout}}}}
\class{Telnet} represents a connection to a Telnet server. The
instance is initially not connected by default; the \method{open()}
method must be used to establish a connection. Alternatively, the
host name and optional port number can be passed to the constructor,
to, in which case the connection to the server will be established
before the constructor returns.
+The optional \var{timeout} parameter specifies a timeout in seconds for the
+connection attempt (if not specified, or passed as None, the global default
+timeout setting will be used).
Do not reopen an already connected instance.
@@ -111,10 +114,13 @@ The callback should access these data when it was invoked with a
\versionadded{2.3}
\end{methoddesc}
-\begin{methoddesc}{open}{host\optional{, port}}
+\begin{methoddesc}{open}{host\optional{, port\optional{, timeout}}}
Connect to a host.
The optional second argument is the port number, which
defaults to the standard Telnet port (23).
+The optional \var{timeout} parameter specifies a timeout in seconds for the
+connection attempt (if not specified, or passed as None, the global default
+timeout setting will be used).
Do not try to reopen an already connected instance.
\end{methoddesc}