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

Method write

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

Write a string to the socket, doubling any IAC characters. Can block if the connection is blocked. May raise OSError if the connection is closed.

(self, buffer)

Source from the content-addressed store, hash-verified

282 return self.sock.fileno()
283
284 def write(self, buffer):
285 """Write a string to the socket, doubling any IAC characters.
286
287 Can block if the connection is blocked. May raise
288 OSError if the connection is closed.
289
290 """
291 if IAC in buffer:
292 buffer = buffer.replace(IAC, IAC+IAC)
293 sys.audit("telnetlib.Telnet.write", self, buffer)
294 self.msg("send %r", buffer)
295 self.sock.sendall(buffer)
296
297 def read_until(self, match, timeout=None):
298 """Read until a given string is encountered or until timeout.

Callers 3

interactMethod · 0.95
mt_interactMethod · 0.95
listenerMethod · 0.45

Calls 3

msgMethod · 0.95
replaceMethod · 0.45
sendallMethod · 0.45

Tested by

no test coverage detected