(self)
| 285 | return False |
| 286 | |
| 287 | def handle_accept(self): |
| 288 | pair = self.accept() |
| 289 | if pair is not None: |
| 290 | sock, addr = pair |
| 291 | state.ownAddresses[state.Peer(sock.getsockname()[0], sock.getsockname()[1])] = True |
| 292 | if len(network.connectionpool.BMConnectionPool().inboundConnections) + \ |
| 293 | len(network.connectionpool.BMConnectionPool().outboundConnections) > \ |
| 294 | BMConfigParser().safeGetInt("bitmessagesettings", "maxtotalconnections") + \ |
| 295 | BMConfigParser().safeGetInt("bitmessagesettings", "maxbootstrapconnections") + 10: |
| 296 | # 10 is a sort of buffer, in between it will go through the version handshake |
| 297 | # and return an error to the peer |
| 298 | logger.warning("Server full, dropping connection") |
| 299 | sock.close() |
| 300 | return |
| 301 | try: |
| 302 | network.connectionpool.BMConnectionPool().addConnection(TCPConnection(sock=sock)) |
| 303 | except socket.error: |
| 304 | pass |
| 305 | |
| 306 | |
| 307 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected