import { MediatorSystem } from "../MediatorSystem"; import { ISlaveServer } from "../../slave/SlaveServer"; import { IServer } from "../../../protocol/server/IServer"; import { ParallelSystemArrayMediator } from "../ParallelSystemArrayMediator"; import { ParallelSystem } from "../ParallelSystem"; import { DistributedSystemArrayMediator } from "../../distributed/DistributedSystemArrayMediator"; import { DistributedSystem } from "../../distributed/DistributedSystem"; import { IClientDriver } from "../../../protocol/communicator/IClientDriver"; /** * A mediator server, driver for the master client. * * The {@link MediatorServer} is a class opening a server accepting the **master** client, following the protocol of * Samchon Framework's own. * * #### [Inherited] {@link MediatorSystem} * @copydoc MediatorSystem */ export declare class MediatorServer extends MediatorSystem implements ISlaveServer { /** * @hidden */ private server_base_; /** * @hidden */ private port; /** * Initializer Constructor. * * @param systemArray The parent {@link ParallelSystemArrayMediator} object. * @param port Port number of server to open. */ constructor(systemArray: ParallelSystemArrayMediator, port: number); /** * Initializer Constructor. * * @param systemArray The parent {@link DistributedSystemArrayMediator} object. * @param port Port number of server to open. */ constructor(systemArray: DistributedSystemArrayMediator, port: number); /** * Factory method creating {@link IServer} object. * * This method {@link createServerBase createServerBase()} determines which protocol is used in this server, * {@link MediatorServer}. Note that, **slave** (this {@link MediatorServer} object) must follow the **master**'s * * * Overrides and return one of them considering the which protocol to follow: * * - {@link ServerBase} * - {@link WebServerBase} * - {@link SharedWorkerServerBase} */ protected createServerBase(): IServer; /** * Add a newly connected remote client. * * {@link MediatorServer} represents a **slave** dedicating to its **master**. In that reason, the * {@link MediatorServer} does not accept multiple **master** clients. It accepts only one. Thus, *listener* of * the *communicator* is {@link MediatorSystem} object, itself. * * @param driver A communicator with remote client. */ addClient(driver: IClientDriver): void; /** * @inheritdoc */ start(): void; /** * @inheritdoc */ open(port: number): void; /** * @inheritdoc */ close(): void; } /** * A mediator server, driver for the master client. * * The {@link MediatorWebServer} is a class opening a server accepting the **master** client, following the * web-socket * * #### [Inherited] {@link MediatorSystem} * @copydoc MediatorSystem */ export declare class MediatorWebServer extends MediatorServer { /** * @inheritdoc */ protected createServerBase(): IServer; } /** * A mediator server, driver for the master client. * * The {@link MediatorDedicatedWorkerServer} is a class opening a server accepting the **master** client, following * the DedicatedWorker's * * #### [Inherited] {@link MediatorSystem} * @copydoc MediatorSystem */ export declare class MediatorDedicatedWorkerServer extends MediatorServer { /** * @inheritdoc */ protected createServerBase(): IServer; } /** * A mediator server, driver for the master client. * * The {@link MediatorSharedWorkerServer} is a class opening a server accepting the **master** client, following the * SharedWorker's * * #### [Inherited] {@link MediatorSystem} * @copydoc MediatorSystem */ export declare class MediatorSharedWorkerServer extends MediatorServer { /** * @inheritdoc */ protected createServerBase(): IServer; }