@ntrip/caster
Version:
NTRIP caster
40 lines (39 loc) • 1.66 kB
TypeScript
/// <reference types="node" />
import events = require('events');
import { CasterConnectionParameters, CasterTransportInterface } from '../caster';
import { Connection } from '../connection';
export declare abstract class Transport extends events.EventEmitter {
protected readonly caster: CasterTransportInterface;
private readonly _connections;
get connections(): ReadonlySet<Connection>;
/**
* Constructs a new NTRIP transport
*
* @param caster NTRIP manager that initiated this transport
* @param options Options for subclasses
*/
protected constructor(caster: CasterTransportInterface, options: any);
/** Opens any servers necessary for this transport */
abstract open(): void;
/** Closes any established servers and existing connections */
close(): void;
protected error(error: Error): void;
/**
* Makes a connection to the caster
*
* @param params Caster connection parameters, excluding transport
* @throws TODO
*/
protected connect(params: Omit<CasterConnectionParameters, 'transport'>): Connection;
/** Returns a description of this transport for use in logging */
abstract get description(): string;
/** Returns a description of a specific connection from this transport for use in logging */
connectionDescription(source: string | object): string;
}
export declare abstract class SingleConnectionTransport extends Transport {
private _connection?;
get connection(): Connection | undefined;
protected connect(params: Omit<CasterConnectionParameters, 'transport'>): Connection;
closeWrapper: () => void;
close(): void;
}