MCPcopy Index your code
hub / github.com/RustPython/RustPython / write

Method write

Lib/socket.py:734–748  ·  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

732 raise
733
734 def write(self, b):
735 """Write the given bytes or bytearray object *b* to the socket
736 and return the number of bytes written. This can be less than
737 len(b) if not all data could be written. If the socket is
738 non-blocking and no bytes could be written None is returned.
739 """
740 self._checkClosed()
741 self._checkWritable()
742 try:
743 return self._sock.send(b)
744 except error as e:
745 # XXX what about EINTR?
746 if e.errno in _blocking_errnos:
747 return None
748 raise
749
750 def readable(self):
751 """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