EndPoint Class

Common functionality for all end point handlers

class EndPoint extends EventEmitter<any> {
    get owner(): Cantabile;
    get endPoint(): string;
    get data(): string;
    connect(): Promise<void>;
    disconnect(): void;
    get isConnected(): boolean;
    get willConnect(): boolean;
    waitForConnected(): Promise<void>;
}

#Properties

#data

Gets the last received raw data for this end point

get data(): string;

#endPoint

Gets the end point url for this endpoint

get endPoint(): string;

#isConnected

Checks if this end point is current connected

get isConnected(): boolean;

#owner

Gets the owning session of this end point

get owner(): Cantabile;

#willConnect

Checks if this end point will connect when the session connects

get willConnect(): boolean;

#Methods

#connect()

Connects this end point and starts listening for events.

Usually this method doesn't need to be called since the session object normally automatically connects end point objects when first accessed

connect(): Promise<void>;

#disconnect()

Disconnect this end point and stops listening for events.

Usually this method should never be used

disconnect(): void;

#waitForConnected()

Returns a promise that will be resolved when this end point is opened

waitForConnected(): Promise<void>;

Example

await C.application.waitForConnected();