The default message handler for both the Shell and Control sockets. This dispatches the message to the appropriate message handler, based on the type of the message.
function messageHandler() {
  var message = messages.read(arguments, _session.signer);
  if (!message) {
    return;
  }

  var handler = _session.handlers[message.header.msg_type];
  if (handler) {
    handler(message);
  }
}