MCPcopy Create free account
hub / github.com/pexpect/pexpect / send

Method send

pexpect/socket_pexpect.py:87–94  ·  view source on GitHub ↗

Write to socket, return number of bytes written

(self, s)

Source from the content-addressed store, hash-verified

85 return self.socket.fileno() >= 0
86
87 def send(self, s) -> int:
88 """Write to socket, return number of bytes written"""
89 s = self._coerce_send_string(s)
90 self._log(s, "send")
91
92 b = self._encoder.encode(s, final=False)
93 self.socket.sendall(b)
94 return len(b)
95
96 def sendline(self, s) -> int:
97 """Write to socket with trailing newline, return number of bytes written"""

Callers 2

sendlineMethod · 0.95
writeMethod · 0.95

Calls 3

_coerce_send_stringMethod · 0.80
_logMethod · 0.80
encodeMethod · 0.80

Tested by

no test coverage detected