MiniGameSocket
Defined in: net/MiniGameSocket.ts:18
The platform-neutral socket surface (GameSocket / WeChatSocket / a Node ws
wrapper all fit): multicast on(event, fn) → unsubscribe, queues sends
until open, moves string|ArrayBuffer frames.
Extended by
Section titled “Extended by”Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MiniGameSocket(
options,global):MiniGameSocket
Defined in: net/MiniGameSocket.ts:28
Parameters
Section titled “Parameters”options
Section titled “options”global
Section titled “global”MiniGameGlobal
Returns
Section titled “Returns”MiniGameSocket
Properties
Section titled “Properties”readyState
Section titled “readyState”readyState:
PlatformSocketReadyState='closed'
Defined in: net/MiniGameSocket.ts:26
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”close()
Section titled “close()”close(
code?,reason?):void
Defined in: net/MiniGameSocket.ts:89
Parameters
Section titled “Parameters”number
reason?
Section titled “reason?”string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”connect()
Section titled “connect()”connect():
void
Defined in: net/MiniGameSocket.ts:41
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”on<
K>(event,handler): () =>void
Defined in: net/MiniGameSocket.ts:34
Type Parameters
Section titled “Type Parameters”K extends keyof PlatformSocketEvents
Parameters
Section titled “Parameters”K
handler
Section titled “handler”(…args) => void
Returns
Section titled “Returns”() => void
Implementation of
Section titled “Implementation of”send()
Section titled “send()”send(
data):void
Defined in: net/MiniGameSocket.ts:81
Parameters
Section titled “Parameters”string | ArrayBuffer
Returns
Section titled “Returns”void