Skip to content

Class: WebSocketTransport ​

Implements ​

Constructors ​

Constructor ​

ts
new WebSocketTransport(url, opts?): WebSocketTransport;

Parameters ​

ParameterType
urlstring
optsWebSocketTransportOptions

Returns ​

WebSocketTransport

Accessors ​

state ​

Get Signature ​

ts
get state(): TransportState;
Returns ​

TransportState

Implementation of ​

Transport.state

Methods ​

close() ​

ts
close(code?, reason?): void;

Parameters ​

ParameterTypeDefault value
codenumber1000
reasonstring''

Returns ​

void

Implementation of ​

Transport.close


open() ​

ts
open(handlers): void;

Begins connecting. handlers.onOpen or handlers.onClose will follow.

Parameters ​

ParameterType
handlersTransportHandlers

Returns ​

void

Implementation of ​

Transport.open


send() ​

ts
send(bytes): void;

Never throws: a send on a dead socket is reported through onClose, which is the path a caller already has to handle.

Parameters ​

ParameterType
bytesUint8Array

Returns ​

void

Implementation of ​

Transport.send

Talkline documentation