bug for linux

This commit is contained in:
2020-04-01 11:43:06 +08:00
parent 3f1329e020
commit 1cd3e7fe08
3 changed files with 5 additions and 3 deletions

View File

@@ -5,6 +5,6 @@ import sys
python = sys.executable python = sys.executable
while True: while True:
code = os.system('python msw.py') code = os.system(python + ' msw.py')
if code: if code:
break break

View File

@@ -61,7 +61,7 @@ class Network_controller: # manage id and connection
dp.method = 'get' dp.method = 'get'
dp.body = b'mht' dp.body = b'mht'
print('Send mht request', dp) #print('Send mht request', dp)
send_queue.put(dp) send_queue.put(dp)
@@ -90,7 +90,7 @@ class Network_controller: # manage id and connection
try: try:
conn.connect(addr) conn.connect(addr)
except Exception as e: except Exception as e:
print('Connect to %s failed, %s: %s' % (str(addr), type(e), str(e))) #print('Connect to %s failed, %s: %s' % (str(addr), type(e), str(e)))
return return
connection = Connection(conn, addr, self, positive=True, conntype=conntype) connection = Connection(conn, addr, self, positive=True, conntype=conntype)
@@ -199,6 +199,7 @@ class Network_controller: # manage id and connection
listen_ip = jsondata.try_to_read_jsondata('listen_ip', '127.0.0.1') listen_ip = jsondata.try_to_read_jsondata('listen_ip', '127.0.0.1')
listen_port = jsondata.try_to_read_jsondata('listen_port', 3900) listen_port = jsondata.try_to_read_jsondata('listen_port', 3900)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((listen_ip, listen_port)) s.bind((listen_ip, listen_port))
listen_num = jsondata.try_to_read_jsondata('listen_num', 39) listen_num = jsondata.try_to_read_jsondata('listen_num', 39)

1
resources/testfile.txt Normal file
View File

@@ -0,0 +1 @@
I am here~!!!