code: function(msg) {
          var ack;
  
          if (msg.type === asyncMessageType.MESSAGE_ACK_NEEDED || msg.type === asyncMessageType.MESSAGE_SENDER_ACK_NEEDED) {
            ack = function() {
              pushSendData({
                type: asyncMessageType.ACK,
                content: {
                  messageId: msg.id
                }
              });
            }
          }
  
          switch (msg.type) {
            case asyncMessageType.PING:
              handlePingMessage(msg);
              break;
  
            case asyncMessageType.SERVER_REGISTER:
              handleServerRegisterMessage(msg);
              break;
  
            case asyncMessageType.DEVICE_REGISTER:
              handleDeviceRegisterMessage(msg.content);
              break;
  
            case asyncMessageType.MESSAGE:
              fireEvent("message", msg);
              break;
  
            case asyncMessageType.MESSAGE_ACK_NEEDED:
            case asyncMessageType.MESSAGE_SENDER_ACK_NEEDED:
              ack();
              fireEvent("message", msg);
              break;
  
            case asyncMessageType.ACK:
              fireEvent("message", msg);
              if (ackCallback[msg.senderMessageId] == "function") {
                ackCallback[msg.senderMessageId]();
                delete ackCallback[msg.senderMessageId];
              }
              break;
  
            case asyncMessageType.ERROR_MESSAGE:
              fireEvent("error", {
                errorCode: 4002,
                errorMessage: "Async Error!",
                errorEvent: msg
              });
              break;
          }
        }
docs: *****************************************************
  P R I V A T E   M E T H O D S            *
  *****************************************************