GameSocket
Defined in: net/GameSocket.ts:19
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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GameSocket(
options):GameSocket
Defined in: net/GameSocket.ts:28
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”GameSocket
Properties
Section titled “Properties”readyState
Section titled “readyState”readyState:
PlatformSocketReadyState='closed'
Defined in: net/GameSocket.ts:26
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”close()
Section titled “close()”close(
code?,reason?):void
Defined in: net/GameSocket.ts:85
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/GameSocket.ts:40
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”on<
K>(event,handler): () =>void
Defined in: net/GameSocket.ts:33
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/GameSocket.ts:77
Parameters
Section titled “Parameters”string | ArrayBuffer
Returns
Section titled “Returns”void