|
|
|
|
@ -3,7 +3,6 @@ import select |
|
|
|
|
import socket |
|
|
|
|
import threading |
|
|
|
|
import random |
|
|
|
|
import config |
|
|
|
|
from Queue import Queue, Empty |
|
|
|
|
|
|
|
|
|
MAGIC_PACKET = "" |
|
|
|
|
@ -76,9 +75,9 @@ def get_local_ip(): |
|
|
|
|
while waiting: |
|
|
|
|
s2.sendto(bytes(MAGIC_PACKET), ('<broadcast>', 8888)) |
|
|
|
|
try: |
|
|
|
|
address = queue.get(False) |
|
|
|
|
address = queue.get_nowait() |
|
|
|
|
except Empty: |
|
|
|
|
address = [config.IP] |
|
|
|
|
finally: |
|
|
|
|
pass |
|
|
|
|
else: |
|
|
|
|
waiting = False |
|
|
|
|
return address[0] |
|
|
|
|
|