mirror of
https://github.com/craigerl/aprsd.git
synced 2025-06-25 05:25:21 -04:00
socket timeout 5 minutes
This commit is contained in:
parent
4b67df2907
commit
e6995c3605
@ -82,7 +82,11 @@ ack_dict = {}
|
|||||||
message_number = 0
|
message_number = 0
|
||||||
|
|
||||||
# global telnet connection object -- not needed anymore
|
# global telnet connection object -- not needed anymore
|
||||||
tn = None
|
#tn = None
|
||||||
|
|
||||||
|
# set default encoding for python, so body.decode doesn't blow up in email thread
|
||||||
|
reload(sys)
|
||||||
|
sys.setdefaultencoding('utf8')
|
||||||
|
|
||||||
# command line args
|
# command line args
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
@ -116,7 +120,7 @@ def setup_connection():
|
|||||||
try:
|
try:
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
sock.connect((CONFIG['aprs']['host'], 14580))
|
sock.connect((CONFIG['aprs']['host'], 14580))
|
||||||
# sock.settimeout(300)
|
sock.settimeout(300)
|
||||||
connected = True
|
connected = True
|
||||||
LOG.debug("Connected to server: " + CONFIG['aprs']['host'])
|
LOG.debug("Connected to server: " + CONFIG['aprs']['host'])
|
||||||
sock_file = sock.makefile(mode='r')
|
sock_file = sock.makefile(mode='r')
|
||||||
@ -681,6 +685,7 @@ def main(args=args):
|
|||||||
# put message_number:1 in dict to record the ack
|
# put message_number:1 in dict to record the ack
|
||||||
a = re.search('^ack([0-9]+)', message)
|
a = re.search('^ack([0-9]+)', message)
|
||||||
ack_dict.update({int(a.group(1)): 1})
|
ack_dict.update({int(a.group(1)): 1})
|
||||||
|
continue # break out of this so we don't ack an ack at the end
|
||||||
|
|
||||||
# EMAIL (-)
|
# EMAIL (-)
|
||||||
# is email command
|
# is email command
|
||||||
|
Loading…
x
Reference in New Issue
Block a user