|
|
@ -90,6 +90,11 @@ def webrtc_message(data): |
|
|
|
print("unknown message type") |
|
|
|
socketio.emit('message', data=data, room=ROOM, namespace='/webrtc', skip_sid=sid) |
|
|
|
|
|
|
|
@socketio.on('ping_message', namespace='/webrtc') |
|
|
|
def ping_message(data): |
|
|
|
sid = request.sid |
|
|
|
print("Received ping from %s" % sid) |
|
|
|
socketio.emit('ping_message', data={ 'type':'pong' }, room=sid, namespace='/webrtc') |
|
|
|
|
|
|
|
@socketio.on('disconnect', namespace='/webrtc') |
|
|
|
def disconnect(): |
|
|
@ -111,11 +116,6 @@ def connect(): |
|
|
|
if sid != webrtccamera.sid: |
|
|
|
serial.add_callback('B', display_battery) |
|
|
|
|
|
|
|
@socketio.on('ping', namespace='/webrtc') |
|
|
|
def ping(): |
|
|
|
sid = request.sid |
|
|
|
print("Received ping from %s" % sid) |
|
|
|
|
|
|
|
@socketio.on_error_default |
|
|
|
def default_error_handler(e): |
|
|
|
print(request.event["message"]) # "my error event" |
|
|
|