MessagePortTransport
Defined in: net/MessagePortTransport.ts:24
The minimal socket surface NetChannel drives (GameSocket / WeChatSocket fit).
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MessagePortTransport(
port):MessagePortTransport
Defined in: net/MessagePortTransport.ts:28
Parameters
Section titled “Parameters”MessagePortLike | MessagePort
Returns
Section titled “Returns”MessagePortTransport
Methods
Section titled “Methods”close()
Section titled “close()”close():
void
Defined in: net/MessagePortTransport.ts:47
Returns
Section titled “Returns”void
on(
event,handler): () =>void
Defined in: net/MessagePortTransport.ts:39
Subscribe to incoming frames. Returns an unsubscribe function.
Parameters
Section titled “Parameters”"message"
handler
Section titled “handler”(data) => void
Returns
Section titled “Returns”() => void
Implementation of
Section titled “Implementation of”send()
Section titled “send()”send(
data):void
Defined in: net/MessagePortTransport.ts:43
Parameters
Section titled “Parameters”string | ArrayBuffer
Returns
Section titled “Returns”void