Channel
Wrapper class for RTCDataChannel
and WebSocket
.
Constructor Summary
Public Constructor | ||
public |
constructor(channel: WebSocket | RTCDataChannel, webChannel: WebChannel, peerId: number) Creates a channel from existing |
Member Summary
Public Members | ||
public set |
|
|
public set |
|
|
public set |
onMessage(handler: function(msg: ArrayBuffer)): * |
|
public |
Identifier of the peer who is at the other end of this channel |
|
public |
send: function(message: ArrayBuffer) Send message. |
|
public |
The |
Method Summary
Public Methods | ||
public |
|
|
public |
close() Close the channel. |
|
public |
|
Public Constructors
public constructor(channel: WebSocket | RTCDataChannel, webChannel: WebChannel, peerId: number) source
Creates a channel from existing RTCDataChannel
or WebSocket
.
Params:
Name | Type | Attribute | Description |
channel | WebSocket | RTCDataChannel | Data channel or web socket |
|
webChannel | WebChannel | The |
|
peerId | number | Identifier of the peer who is at the other end of this channel |