Moved out init for socket to MessageProcessor class.