Class: Protocol

Protocol

Document a namespace object of Protocol.

global new Protocol(url, options)

RSWP - The Web Protocol API Provider

Name Type Description
url string

websocket url

options object

protocol options

Version:
  • 1.0.5
Author:
See:

Requires

Classes

Console
Message

Namespaces

CommonStructures
DataSignatures
DataStructures
LocalSignatures
LocalStructures
ScreenSignatures
ScreenStructures

Members

static,constant Protocol.CHANGELOG array.<{type: string, ver: string, msg: string}>

Change log of Mobizen Web Protocol

Example
CHANGES: [
  {type: 'ADDED', ver: '1.0.5', msg: 'using worker for screen data unpack'},
  {type: 'ADDED', ver: '1.0.4', msg: 'atomJPEG decoding'},
  {type: 'ADDED', ver: '1.0.3', msg: 'request a new type of the Struct'},
  ...
]

static,constant Protocol.DEBUG boolean

Debugging flag

static,constant Protocol.LOGGING boolean

Logging flag

static,constant Protocol.VERSION string

filter object

Properties:
Name Type Argument Description
channel string <nullable>
showtype string <nullable>

onclose

TODO
  • relay모드일 때 screen 채널만 끊어지는 경우 발생(reconnect도 안되고... 뭔가 처리가 필요함);

ondata

onopen

options object

Properties:
Name Type Description
useWorker boolean
useBlobURL boolean
workerPath string

Noop Time Delay

Connect Type

url string

Type Definitions

static Protocol.JpegParser(buffer, subtype, useBlob)

Name Type Description
buffer arrayBuffer
subtype number
useBlob boolean
Author:

Methods

Name Type Description
channel string

The name of channel of socket.

getProtocol(options)

Name Type Description
options object

log(direction, channel, packet){string}

Name Type Description
direction string
channel string

The name of channel of socket.

packet Struct
Returns:
Type Description
string a HTML tag

virtual log(direction, channel, packet)

Name Type Description
direction string
channel string

The name of channel of socket.

packet Struct

open(channel, socket)

Name Type Description
channel string

The name of channel of socket.

socket WebSocket

request(channel, payloadType, messageId, data, unionId){object}

Name Type Description
channel string

The name of channel of socket.

payloadType number| string
messageId number| string
data object optional
unionId number optional
Returns:
Type Description
object data from struct

response(channel, payload, data)

Name Type Description
channel string

The name of channel of socket.

payload object
data object

inner ab2hex(buf){string}

Name Type Description
buf arrayBuffer
Returns:
Type Description
string hexCodes

inner ab2str(buf){string}

Name Type Description
buf arrayBuffer
Returns:
Type Description
string charCodes

inner ab162str(buf){string}

Name Type Description
buf arrayBuffer
Returns:
Type Description
string charCodes

inner append(buffer1, buffer2){arrayBuffer}

Name Type Description
buffer1 arrayBuffer
buffer2 arrayBuffer
TODO
  • FIXME: DO NOT USE ARRAYBUFFER APPENDING!!
Returns:
Type Description
arrayBuffer merged buffer

inner extend(destination, source){object}

Object Extend.

Name Type Description
destination object

A destination object.

source object optional

A source object.

Returns:
Type Description
object Extended object.

inner inherits(ctor, superCtor, proto)

Class Inherits

Name Type Description
ctor Constructor

constructor

superCtor Constructor

super constructor

proto Prototype optional

constructor.prototype

inner setZeroTimeout(global)

Name Type Description
global object
comments powered by Disqus