JSLib Reference Manual / Exports / ChannelSocket

Class: ChannelSocket#

ChannelSocket

Class managing connections

Hierarchy#

Table of contents#

Constructors#

Properties#

Accessors#

Methods#

Constructors#

constructor#

new ChannelSocket(sbServer, onMessage, key?, channelId?)

ChannelSocket

Parameters#

Name

Type

sbServer

SBServer

onMessage

(m: ChannelMessage) => void

key?

JsonWebKey

channelId?

string

Overrides#

Channel.constructor

Properties#

admin#

admin: boolean = false

Inherited from#

Channel.admin


adminData#

Optional adminData: ChannelAdminData

Overrides#

Channel.adminData


channelReady#

channelReady: Promise<Channel>

Param

server to join

Param

key to use to join (optional)

Param

the Channel Name to find on that server (optional)

Inherited from#

Channel.channelReady


locked#

Optional locked: boolean = false

Inherited from#

Channel.locked


motd#

Optional motd: string = ''

Inherited from#

Channel.motd


owner#

owner: boolean = false

Inherited from#

Channel.owner


ready#

ready: Promise<ChannelSocket>

Overrides#

Channel.ready


sb384Ready#

sb384Ready: Promise<SB384>

Inherited from#

Channel.sb384Ready


userName#

userName: string = ''

Inherited from#

Channel.userName


verifiedGuest#

verifiedGuest: boolean = false

Inherited from#

Channel.verifiedGuest

Accessors#

_id#

get _id(): string

Returns#

string

Inherited from#

Channel._id


api#

get api(): ChannelApi

Returns#

ChannelApi

Inherited from#

Channel.api


channelId#

get channelId(): undefined | string

Returns#

undefined | string

Inherited from#

Channel.channelId


channelSignKey#

get channelSignKey(): CryptoKey

Returns#

CryptoKey

Inherited from#

Channel.channelSignKey


enableTrace#

set enableTrace(b): void

Enables debug output

Parameters#

Name

Type

b

boolean

Returns#

void


exportable_owner_pubKey#

get exportable_owner_pubKey(): null | JsonWebKey

Returns#

null | JsonWebKey


exportable_privateKey#

get exportable_privateKey(): JsonWebKey

Returns#

JsonWebKey

Inherited from#

Channel.exportable_privateKey


exportable_pubKey#

get exportable_pubKey(): JsonWebKey

Returns#

JsonWebKey

Inherited from#

Channel.exportable_pubKey


keys#

get keys(): ChannelKeys

Returns#

ChannelKeys

Inherited from#

Channel.keys


onMessage#

get onMessage(): (m: ChannelMessage) => void

Returns#

fn

▸ (m): void

Parameters#

Name

Type

m

ChannelMessage

Returns#

void

set onMessage(f): void

Parameters#

Name

Type

f

(m: ChannelMessage) => void

Returns#

void


ownerChannelId#

get ownerChannelId(): string

Returns#

string

Inherited from#

Channel.ownerChannelId


privateKey#

get privateKey(): CryptoKey

Returns#

CryptoKey

Inherited from#

Channel.privateKey


readyFlag#

get readyFlag(): boolean

Returns#

boolean

Inherited from#

Channel.readyFlag


sbServer#

get sbServer(): SBServer

Returns#

SBServer

Inherited from#

Channel.sbServer


status#

get status(): "CLOSED" | "CONNECTING" | "OPEN" | "CLOSING"

Returns#

"CLOSED" | "CONNECTING" | "OPEN" | "CLOSING"

Methods#

close#

close(): void

Returns#

void


send#

send(msg): Promise<string>

ChannelSocket.send()

Returns a promise that resolves to “success” when sent, or an error message if it fails.

Parameters#

Name

Type

msg

string | SBMessage

Returns#

Promise<string>

Overrides#

Channel.send