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)
| 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. |