可选
host: stringThe server address.
可选
port: numberThe server port.
可选
protocols: string[]Subprotocol names. A string or an array of strings of subprotocol names.
可选
isSecure: booleanWhether to use the WebSocket secure protocol wss, default (false) uses the ordinary protocol ws.
The server address.
The server port.
可选
isSecure: booleanWhether to use the WebSocket secure protocol wss, default (false) uses the ordinary protocol ws.
可选
protocols: string[]Subprotocol names. A string or an array of strings of subprotocol names.
Connect to the specified host and port.
The server address.
The server port.
可选
isSecure: booleanWhether to use the WebSocket secure protocol wss, default (false) uses the ordinary protocol ws.
可选
options: IWebSocketConnectOptionsOptions for the WebSocket connection.
Connect to the specified host and port.
The server WebSocket URL to connect to. The URL is similar to ws://yourdomain:port.
可选
protocols: string[]Subprotocol names. A string or an array of strings of subprotocol names.
Connect to the specified server WebSocket URL. The URL is similar to ws://yourdomain:port.
The server WebSocket URL to connect to. The URL is similar to ws://yourdomain:port.
可选
options: IWebSocketConnectOptionsOptions for the WebSocket connection.
Connect to the specified server WebSocket URL. The URL is similar to ws://yourdomain:port.
The type of event.
可选
data: any(Optional) Data to pass to the callback. If multiple parameters p1, p2, p3, ... need to be passed, use an array structure such as [p1, p2, p3, ...]. If a single parameter p needs to be passed and p is an array, use a structure such as [p]. For other single parameters p, you can directly pass parameter p. If data is Event.EMPTY, it means passing an Event object to the callback function. Note that it is not passing Event.TEMP, but an independent Event object.
True if there are listeners for this event type, false otherwise.
The type of event.
The listener function.
This EventDispatcher object.
The type of event.
The execution scope of the event listener function.
可选
listener: FunctionThe listener function.
可选
args: any[]This EventDispatcher object.
可选
type: string(Optional) The type of event. If the value is null, all types of listeners on this object are removed.
This EventDispatcher object.
The target caller object.
This EventDispatcher object.
The type of event.
The listener function.
This EventDispatcher object.
The type of event.
The execution scope of the event listener function.
The listener function.
可选
args: any[](Optional) The callback parameters of the event listener function.
This EventDispatcher object.
The type of event.
The listener function.
This EventDispatcher object.
The type of event.
The execution scope of the event listener function.
The listener function.
可选
args: any[](Optional) The callback parameters of the event listener function.
This EventDispatcher object.
En
Socket encapsulates HTML5 WebSocket, allowing full-duplex real-time communication between server and client, and cross-domain communication. After establishing a connection, both server and Browser/Client Agent can actively send or receive text and binary data to each other.
Zh
Socket 封装了 HTML5 WebSocket,允许服务器端与客户端进行全双工(full-duplex)的实时通信,并且允许跨域通信。在建立连接后,服务器和 Browser/Client Agent 都能主动的向对方发送或接收文本和二进制数据。
Blueprintable