Class WebSocketLinker<T, U>
Constructors
constructor
- new WebSocketLinker<T, U>(url, parseData, messageHandler, parseFun?): WebSocketLinker<T, U>
Parameters
- url: string
- parseData: U
- messageHandler: U extends true
? WSMessageTypeExt<string, T>
: WSMessageType<string> Optional
parseFun: ((ev: MessageEvent<string>) => string)- (ev): string
Returns string
Methods
cancelReConnect
- cancelReConnect(): void
Returns void
close
- close(): void
Returns void
connect
- connect(): void
Returns void
WebSocket链接器类,提供WebSocket连接和消息处理功能。