MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / open

Method open

tools/python-3.11.9-amd64/Lib/telnetlib.py:223–238  ·  view source on GitHub ↗

Connect to a host. The optional second argument is the port number, which defaults to the standard telnet port (23). Don't try to reopen an already connected instance.

(self, host, port=0, timeout=socket._GLOBAL_DEFAULT_TIMEOUT)

Source from the content-addressed store, hash-verified

221 self.open(host, port, timeout)
222
223 def open(self, host, port=0, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
224 """Connect to a host.
225
226 The optional second argument is the port number, which
227 defaults to the standard telnet port (23).
228
229 Don't try to reopen an already connected instance.
230 """
231 self.eof = 0
232 if not port:
233 port = TELNET_PORT
234 self.host = host
235 self.port = port
236 self.timeout = timeout
237 sys.audit("telnetlib.Telnet.open", self, host, port)
238 self.sock = socket.create_connection((host, port), timeout)
239
240 def __del__(self):
241 """Destructor -- close the connection."""

Callers 2

__init__Method · 0.95
testFunction · 0.45

Calls 1

create_connectionMethod · 0.45

Tested by

no test coverage detected