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

Method handle_read

src/network/tls.py:91–110  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

89 return AdvancedDispatcher.readable(self)
90
91 def handle_read(self):
92 try:
93 # wait for write buffer flush
94 if self.tlsStarted and not self.tlsDone and not self.write_buf:
95 #logger.debug("%s:%i TLS handshaking (read)", self.destination.host, self.destination.port)
96 self.tls_handshake()
97 else:
98 #logger.debug("%s:%i Not TLS handshaking (read)", self.destination.host, self.destination.port)
99 return AdvancedDispatcher.handle_read(self)
100 except AttributeError:
101 return AdvancedDispatcher.handle_read(self)
102 except ssl.SSLError as err:
103 if err.errno == ssl.SSL_ERROR_WANT_READ:
104 return
105 elif err.errno in _DISCONNECTED_SSL:
106 self.handle_close()
107 return
108 logger.info("SSL Error: %s", str(err))
109 self.handle_close()
110 return
111
112 def handle_write(self):
113 try:

Callers

nothing calls this directly

Calls 2

tls_handshakeMethod · 0.95
handle_closeMethod · 0.45

Tested by

no test coverage detected