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

Method write

tools/python-3.11.9-amd64/Lib/socket.py:715–729  ·  view source on GitHub ↗

Write the given bytes or bytearray object *b* to the socket and return the number of bytes written. This can be less than len(b) if not all data could be written. If the socket is non-blocking and no bytes could be written None is returned.

(self, b)

Source from the content-addressed store, hash-verified

713 raise
714
715 def write(self, b):
716 """Write the given bytes or bytearray object *b* to the socket
717 and return the number of bytes written. This can be less than
718 len(b) if not all data could be written. If the socket is
719 non-blocking and no bytes could be written None is returned.
720 """
721 self._checkClosed()
722 self._checkWritable()
723 try:
724 return self._sock.send(b)
725 except error as e:
726 # XXX what about EINTR?
727 if e.errno in _blocking_errnos:
728 return None
729 raise
730
731 def readable(self):
732 """True if the SocketIO is open for reading.

Callers

nothing calls this directly

Calls 3

_checkClosedMethod · 0.45
_checkWritableMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected