added a socketio example and simplified the implementation