mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-09 05:24:44 +01:00
add timeoutSecs param
This commit is contained in:
parent
37162e0471
commit
284888df44
1 changed files with 2 additions and 2 deletions
|
@ -11,14 +11,14 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
apacheAvailable = False
|
apacheAvailable = False
|
||||||
|
|
||||||
def post(req, params):
|
def post(req, params, timeoutSecs = 1):
|
||||||
err = 'none'
|
err = 'none'
|
||||||
dataLen = 0
|
dataLen = 0
|
||||||
jobj = json.loads(params)
|
jobj = json.loads(params)
|
||||||
data = base64.b64decode(jobj['data'])
|
data = base64.b64decode(jobj['data'])
|
||||||
|
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
sock.settimeout(1) # seconds
|
sock.settimeout(timeoutSecs) # seconds
|
||||||
addr = ("127.0.0.1", 10997)
|
addr = ("127.0.0.1", 10997)
|
||||||
sock.sendto(data, addr)
|
sock.sendto(data, addr)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue