@univerjs/network v0.4.2 • Docs
Interface: ISocket
An interface that represents a socket connection.
Properties
Property | Type | Defined in |
---|---|---|
URL | string | packages/network/src/services/web-socket/web-socket.service.ts:36 (opens in a new tab) |
close$ | Observable <CloseEvent > | packages/network/src/services/web-socket/web-socket.service.ts:45 (opens in a new tab) |
error$ | Observable <Event > | packages/network/src/services/web-socket/web-socket.service.ts:46 (opens in a new tab) |
message$ | Observable <MessageEvent <any >> | packages/network/src/services/web-socket/web-socket.service.ts:47 (opens in a new tab) |
open$ | Observable <Event > | packages/network/src/services/web-socket/web-socket.service.ts:48 (opens in a new tab) |
Methods
close()
close(code?, reason?): void
Parameters
Parameter | Type |
---|---|
code ? | number |
reason ? | string |
Returns
void
Defined in
packages/network/src/services/web-socket/web-socket.service.ts:38 (opens in a new tab)
send()
send(data): void
Send a message to the remote server.
Parameters
Parameter | Type |
---|---|
data | SocketBodyType |
Returns
void
Defined in
packages/network/src/services/web-socket/web-socket.service.ts:43 (opens in a new tab)