| 36 | self.streams.append(streamNumber) |
| 37 | |
| 38 | def getConnectionByAddr(self, addr): |
| 39 | if addr in self.inboundConnections: |
| 40 | return self.inboundConnections[addr] |
| 41 | try: |
| 42 | if addr.host in self.inboundConnections: |
| 43 | return self.inboundConnections[addr.host] |
| 44 | except AttributeError: |
| 45 | pass |
| 46 | if addr in self.outboundConnections: |
| 47 | return self.outboundConnections[addr] |
| 48 | try: |
| 49 | if addr.host in self.udpSockets: |
| 50 | return self.udpSockets[addr.host] |
| 51 | except AttributeError: |
| 52 | pass |
| 53 | raise KeyError |
| 54 | |
| 55 | def isAlreadyConnected(self, nodeid): |
| 56 | for i in self.inboundConnections.values() + self.outboundConnections.values(): |