Class: Message

Message(messageID)

Representation of the packets transproted over the wire.

Constructor

new Message(messageID)

Parameters:
Name Type Description
messageID number

Message ID unique identifying this message.

Source:

Members

(static) Origin

Messages may originate from either the server or the client. Because the remote protocol is full duplex, both endpoints may be the origin of both commands and responses.

Properties:
Name Type Description
Client

Indicates that the message originates from the client.

Server

Indicates that the message originates from the server.

Source:
See:

Methods

(static) fromPacket(data) → {Message}

Converts a data packet into a Command or Response.

Parameters:
Name Type Description
data Array.<number, number, ?, ?>

A four element array where the elements, in sequence, signifies message type, message ID, method name or error, and parameters or result.

Source:
Throws:

If the message type is not recognised.

Type
TypeError
Returns:

Based on the message type, a Command or Response instance.

Type
Message