MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / removeConnection

Method removeConnection

src/Connection/ConnectionServer.py:224–237  ·  view source on GitHub ↗
(self, connection)

Source from the content-addressed store, hash-verified

222 return None
223
224 def removeConnection(self, connection):
225 # Delete if same as in registry
226 if self.ips.get(connection.ip) == connection:
227 del self.ips[connection.ip]
228 # Site locked connection
229 if connection.target_onion:
230 if self.ips.get(connection.ip + connection.target_onion) == connection:
231 del self.ips[connection.ip + connection.target_onion]
232 # Cert pinned connection
233 if connection.cert_pin and self.ips.get(connection.ip + "#" + connection.cert_pin) == connection:
234 del self.ips[connection.ip + "#" + connection.cert_pin]
235
236 if connection in self.connections:
237 self.connections.remove(connection)
238
239 def checkConnections(self):
240 run_i = 0

Callers 1

closeMethod · 0.80

Calls 2

removeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected