android - Scanning local IP address socket programming -
im developing socket-base system between android , ios app. ios acts server (using bourjour publish service). android apps act clients, scan servers, display list of servers on list-view , connect server user-will. both run on emulators (real devices eventually). got specific port system, says 49300 example. problem that, there many local ip addresses scan (192.168.x.x), 255 * 255. develop queue task execute job. here flow:
scan subnet for-loop x = 0 -> 255 scanner >= (queue = 5) wait(); new thread scan 192.168.x.y for-loop y = 0 -> 255 scanner++
scanning thread:
scan 192.168.x.y for-loop y = 0 -> 255 if 192.168.x.y reachable add list end scanner--; notify();
but seems it's work app do, android simulator shutdown, helps appreciated.
Comments
Post a Comment