API Reference
@univerjs
@univerjs/network
interfaces
Isocket

@univerjs/network v0.4.2Docs


Interface: ISocket

An interface that represents a socket connection.

Properties

PropertyTypeDefined in
URLstringpackages/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

ParameterType
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

ParameterType
dataSocketBodyType

Returns

void

Defined in

packages/network/src/services/web-socket/web-socket.service.ts:43 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.