MCPcopy Create free account
hub / github.com/Bitmessage/PyBitmessage / recv

Method recv

src/network/asyncore_pollchoose.py:659–677  ·  view source on GitHub ↗
(self, buffer_size)

Source from the content-addressed store, hash-verified

657 raise
658
659 def recv(self, buffer_size):
660 try:
661 data = self.socket.recv(buffer_size)
662 if not data:
663 # a closed connection is indicated by signaling
664 # a read condition, and having recv() return 0.
665 self.handle_close()
666 return b''
667 else:
668 return data
669 except socket.error as why:
670 # winsock sometimes raises ENOTCONN
671 if why.args[0] in (EAGAIN, EWOULDBLOCK, WSAEWOULDBLOCK):
672 return b''
673 if why.args[0] in _DISCONNECTED:
674 self.handle_close()
675 return b''
676 else:
677 raise
678
679 def close(self):
680 self.connected = False

Callers 9

runMethod · 0.45
queryServerMethod · 0.45
handle_readMethod · 0.45
handle_readMethod · 0.45
handle_readMethod · 0.45
__recvallMethod · 0.45
__connectsocks5Method · 0.45
__resolvesocks5Method · 0.45
__negotiatehttpMethod · 0.45

Calls 1

handle_closeMethod · 0.95

Tested by

no test coverage detected