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:30
Parameters
Section titled “Parameters”options
Section titled “options”global
Section titled “global”MiniGameGlobal
Returns
Section titled “Returns”MiniGameSocket
Properties
Section titled “Properties”delivery
Section titled “delivery”
readonlydelivery:"reliable-ordered"
Defined in: net/MiniGameSocket.ts:27
wx.connectSocket and its siblings are WebSockets like any other.
Implementation of
Section titled “Implementation of”readyState
Section titled “readyState”readyState:
PlatformSocketReadyState='closed'
Defined in: net/MiniGameSocket.ts:28
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”close()
Section titled “close()”close(
code?,reason?):void
Defined in: net/MiniGameSocket.ts:91
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:43
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”on<
K>(event,handler): () =>void
Defined in: net/MiniGameSocket.ts:36
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:83
Parameters
Section titled “Parameters”string | ArrayBuffer
Returns
Section titled “Returns”void