mirror of
https://github.com/gryf/wmdocklib.git
synced 2025-12-18 20:10:23 +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
|
||||
LINE_SPACING = 4
|
||||
|
||||
usage = '''
|
||||
usage = '''\
|
||||
pywmwet.py [options]
|
||||
Available options are:
|
||||
-h, --help Print this help text
|
||||
@@ -69,6 +69,7 @@ def query_server(server, port):
|
||||
query = '\xFF\xFF\xFF\xFF\x02getstatus\x0a\x00'
|
||||
addr = (server, port)
|
||||
sockobj = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
sockobj.settimeout(4.0)
|
||||
sockobj.connect(addr)
|
||||
sockobj.send(query)
|
||||
data = sockobj.recv(4096)
|
||||
|
||||
Reference in New Issue
Block a user