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

Method handle_write

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

Source from the content-addressed store, hash-verified

110 return
111
112 def handle_write(self):
113 try:
114 # wait for write buffer flush
115 if self.tlsStarted and not self.tlsDone and not self.write_buf:
116 #logger.debug("%s:%i TLS handshaking (write)", self.destination.host, self.destination.port)
117 self.tls_handshake()
118 else:
119 #logger.debug("%s:%i Not TLS handshaking (write)", self.destination.host, self.destination.port)
120 return AdvancedDispatcher.handle_write(self)
121 except AttributeError:
122 return AdvancedDispatcher.handle_write(self)
123 except ssl.SSLError as err:
124 if err.errno == ssl.SSL_ERROR_WANT_WRITE:
125 return 0
126 elif err.errno in _DISCONNECTED_SSL:
127 self.handle_close()
128 return 0
129 logger.info("SSL Error: %s", str(err))
130 self.handle_close()
131 return
132
133 def tls_handshake(self):
134 # wait for flush

Callers

nothing calls this directly

Calls 2

tls_handshakeMethod · 0.95
handle_closeMethod · 0.45

Tested by

no test coverage detected