MCPcopy Index your code
hub / github.com/python/cpython / recv

Method recv

Lib/test/support/asyncore.py:375–391  ·  view source on GitHub ↗
(self, buffer_size)

Source from the content-addressed store, hash-verified

373 raise
374
375 def recv(self, buffer_size):
376 try:
377 data = self.socket.recv(buffer_size)
378 if not data:
379 # a closed connection is indicated by signaling
380 # a read condition, and having recv() return 0.
381 self.handle_close()
382 return b''
383 else:
384 return data
385 except OSError as why:
386 # winsock sometimes raises ENOTCONN
387 if why.errno in _DISCONNECTED:
388 self.handle_close()
389 return b''
390 else:
391 raise
392
393 def close(self):
394 self.connected = False

Callers 15

serverMethod · 0.45
clientMethod · 0.45
doMethod · 0.45
recv_allMethod · 0.45
readerMethod · 0.45
test_writer_callbackMethod · 0.45
clientMethod · 0.45
recv_allMethod · 0.45

Calls 1

handle_closeMethod · 0.95

Tested by 15

serverMethod · 0.36
clientMethod · 0.36
doMethod · 0.36
recv_allMethod · 0.36
readerMethod · 0.36
test_writer_callbackMethod · 0.36
clientMethod · 0.36