LocalSignaler
Extends:
한 기기에서 탭끼리 연결하는데 사용할 수 있는 시그널러. BroadcastChannel
을 이용해 시그널을 주고받습니다.
Constructor Summary
Public Constructor | ||
public |
constructor(userConfig: object) 연결을 시작합니다. |
Member Summary
Public Members | ||
public |
bc: * 통신이 이루어질 BroadcastChannel |
|
public |
|
|
public |
설정된 시간 동안 heartbeat를 받지 못하면 연결이 꾾어진 것으로 판정하는 타이머 |
|
public |
id: * 피어를 구분하는 id. |
|
public |
설정된 주기마다 heartbeat 메시지를 보내는 타이머 |
|
public |
sender: * 연결되어 있는 sender의 id |
Method Summary
Public Methods | ||
public |
close() close 훅. |
|
public |
send(msg: *) 상대에게 메시지를 전송합니다. |
Private Methods | ||
private |
receiveHeartbeat(sender: *) heartbeat timeout을 취소하고 ready를 false로 설정합니다. |
Inherited Summary
From class Mitt | ||
public |
이벤트별 이벤트 핸들러들 |
|
public |
addEventListener(type: string | symbol, handler: EventHandler<any>): *
|
|
public |
Invoke all handlers for the given type. |
|
public |
Remove an event handler for the given type. |
|
public |
on(type: string | symbol, handler: EventHandler<any>): * Register an event handler for the given type. |
|
public |
once(type: *, handler: *) |
|
public |
removeEventListener(type: string | symbol, handler: EventHandler<any>): *
|
From class SignalerBase | ||
public |
options: {} RTCEngine 생성시 적용될 설정값들. |
|
public |
ready: * 시그널러가 메시지를 보낼 수 있는 상태인지 나타내는 값. |
|
public |
unhandledMsg: Map<string, any[]> 받은 메시지의 |
|
public abstract |
close(engine: RTCEngine) |
|
public abstract |
connected(engine: RTCEngine) |
|
public abstract |
disconnected(engine: RTCEngine) |
|
public abstract |
failed(engine: RTCEngine) |
|
public |
on(type: string, handler: EventHandler<object>) 특정 |
|
public |
receive(msg: *) 메시지를 엔진에 전달합니다. |
|
public abstract |
send(data: *) |
|
public abstract |
start(engine: RTCEngine) |
Public Constructors
Public Members
Public Methods
public send(msg: *) source
상대에게 메시지를 전송합니다.
Override:
SignalerBase#sendParams:
Name | Type | Attribute | Description |
msg | * | 전송할 메시지. |
Private Methods
private receiveHeartbeat(sender: *) source
heartbeat timeout을 취소하고 ready를 false로 설정합니다.
Params:
Name | Type | Attribute | Description |
sender | * |