mirror of
https://github.com/gryf/wmdocklib.git
synced 2025-12-19 04:20:17 +01:00
1647673: program blanks out
added timeout for socket (hard coded to 4 seconds). removed leading \n in usage string. not modified anything else.
This commit is contained in:
@@ -27,7 +27,7 @@ YOFFSET = 4
|
|||||||
MARGIN = 1
|
MARGIN = 1
|
||||||
LINE_SPACING = 4
|
LINE_SPACING = 4
|
||||||
|
|
||||||
usage = '''
|
usage = '''\
|
||||||
pywmwet.py [options]
|
pywmwet.py [options]
|
||||||
Available options are:
|
Available options are:
|
||||||
-h, --help Print this help text
|
-h, --help Print this help text
|
||||||
@@ -69,6 +69,7 @@ def query_server(server, port):
|
|||||||
query = '\xFF\xFF\xFF\xFF\x02getstatus\x0a\x00'
|
query = '\xFF\xFF\xFF\xFF\x02getstatus\x0a\x00'
|
||||||
addr = (server, port)
|
addr = (server, port)
|
||||||
sockobj = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
sockobj = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
|
sockobj.settimeout(4.0)
|
||||||
sockobj.connect(addr)
|
sockobj.connect(addr)
|
||||||
sockobj.send(query)
|
sockobj.send(query)
|
||||||
data = sockobj.recv(4096)
|
data = sockobj.recv(4096)
|
||||||
|
|||||||
Reference in New Issue
Block a user