Skip to content

Commit

Permalink
warn on many open local ports
Browse files Browse the repository at this point in the history
  • Loading branch information
akshualy committed Aug 22, 2024
1 parent 8dfa3a1 commit 5f4b728
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions alune/adb.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ async def scan_localhost_devices(self) -> int | None:
connections = [
conn for conn in psutil.net_connections("tcp4") if conn.laddr.port >= 5555 and conn.status == "LISTEN"
]

if len(connections) > 9:
logger.warning(f"There are {len(connections)} open ports, scanning may take a while.")

for conn in connections:
logger.debug(f"Scanning port {conn.laddr.port} for ADB...")
try:
Expand Down

0 comments on commit 5f4b728

Please sign in to comment.