move socket handling process to app/controllers/message_controller.js