Class: Message

Protocol~Message

new Message(protocol, channel, websocket)

A Base Class of Protocol Message

Name Type Description
protocol Protocol

A provider of the web protocol API.

channel string

The name of channel of socket.

websocket object

instance

Throws:
Will throw an error if uncaught write protection error

Requires

Classes

Data
Local
Screen

Members

buffer arrayBuffer

channel string

connected boolean

continuous boolean

debug boolean

socket object

url string

Type Definitions

protocol Protocol

A provider of the web protocol API.

translator object

Methods

getHeaderSize(){number}

Returns:
Type Description
number size of header

pack(payloadType, messageId, body){Struct}

Packaging the RC data struct.

Name Type Description
payloadType number

Payload type of packet.

messageId number

Message id of packet.

body Struct optional

Struct of body.

TODO
  • 로컬 채널의 경우에는 패킷 랭스를 보게 되어 있어서 바디가 없는 경우 dataSize를 빼면 오류(추후 수정)
Returns:
Type Description
Struct Struct of RC packet.
Name Type Description
packet arrayBuffer

send(payloadType, messageId, data, unionId){object.<string, object>}

Name Type Description
payloadType number
messageId number
data object optional
unionId number optional
Returns:
Type Description
object.<string, object> sended packet
Name Type Description
chunk arrayBuffer

unpack(packet, payload){object}

Name Type Description
packet arrayBuffer
payload object
Returns:
Type Description
object payload with unpacked data
comments powered by Disqus