diff --git a/example/app.py b/example/app.py
index 59214ea..74a4279 100755
--- a/example/app.py
+++ b/example/app.py
@@ -77,9 +77,15 @@ def send_room_message(sid, message):
room=message['room'], namespace='/test')
+@socketio.on('disconnect request', namespace='/test')
+def disconnect_request(sid):
+ socketio.disconnect(sid, namespace='/test')
+
+
@socketio.on('connect', namespace='/test')
def test_connect(sid, environ):
- socketio.emit('my response', {'data': 'Connected', 'count': 0}, room=sid)
+ socketio.emit('my response', {'data': 'Connected', 'count': 0}, room=sid,
+ namespace='/test')
@socketio.on('disconnect', namespace='/test')
diff --git a/example/templates/index.html b/example/templates/index.html
index 8da7b13..5c37340 100755
--- a/example/templates/index.html
+++ b/example/templates/index.html
@@ -9,12 +9,12 @@
namespace = '/test';
var socket = io.connect('http://' + document.domain + ':' + location.port + namespace);
- socket.on('my response', function(msg) {
- $('#log').append('
Received: ' + msg.data);
- });
socket.on('connect', function() {
socket.emit('my event', {data: 'I\'m connected!'});
});
+ socket.on('my response', function(msg) {
+ $('#log').append('
Received: ' + msg.data);
+ });
// event handler for server sent data
// the data is displayed in the "Received" section of the page
@@ -79,6 +79,9 @@
+