Commit e4b03f32 authored by ibuler's avatar ibuler

[Bugfix] 修改bug

parent 6e516a94
# ~*~ coding: utf-8 ~*~ # ~*~ coding: utf-8 ~*~
import threading import threading
import collections import collections
import time
import json import json
from flask import request, g from flask import request, g
from flask_socketio import send, emit
from jms.utils import to_dotmap from jms.utils import to_dotmap
from .. import app, socket_io from .. import app, socket_io
...@@ -34,10 +36,9 @@ def handle_term_connect(): ...@@ -34,10 +36,9 @@ def handle_term_connect():
def handle_machine(message): def handle_machine(message):
print('Get message: {}'.format(message)) print('Get message: {}'.format(message))
sid = request.sid sid = request.sid
message_json = json.loads(message) time.sleep(1)
asset_id = message_json.get('assetId', 0) emit(message)
system_user_id = message_json.get('sysUserId', 0) time.sleep(10)
socket_io.emit('data', 'Connect assetId: {} sysUserId: {}'.format(asset_id, system_user_id))
socket_io.disconnect() socket_io.disconnect()
return return
clients[sid]['host'] = host = '120.25.240.109' clients[sid]['host'] = host = '120.25.240.109'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment