diff --git a/main.py b/main.py index 6393e55..410e0da 100644 --- a/main.py +++ b/main.py @@ -5,6 +5,6 @@ import sys python = sys.executable while True: - code = os.system('python msw.py') + code = os.system(python + ' msw.py') if code: break \ No newline at end of file diff --git a/plugins/net.py b/plugins/net.py index 45d1d54..65ab674 100644 --- a/plugins/net.py +++ b/plugins/net.py @@ -61,7 +61,7 @@ class Network_controller: # manage id and connection dp.method = 'get' dp.body = b'mht' - print('Send mht request', dp) + #print('Send mht request', dp) send_queue.put(dp) @@ -90,7 +90,7 @@ class Network_controller: # manage id and connection try: conn.connect(addr) 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 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_port = jsondata.try_to_read_jsondata('listen_port', 3900) + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((listen_ip, listen_port)) listen_num = jsondata.try_to_read_jsondata('listen_num', 39) diff --git a/resources/testfile.txt b/resources/testfile.txt new file mode 100644 index 0000000..e99f498 --- /dev/null +++ b/resources/testfile.txt @@ -0,0 +1 @@ +I am here~!!! \ No newline at end of file