UNPKG

1.06 kBTypeScriptView Raw
1import { Server as NetSocket, Socket } from 'net';
2import { Transport } from '../enums';
3import { TcpSocket } from '../helpers';
4import { CustomTransportStrategy } from '../interfaces';
5import { TcpOptions } from '../interfaces/microservice-configuration.interface';
6import { Server } from './server';
7/**
8 * @publicApi
9 */
10export declare class ServerTCP extends Server implements CustomTransportStrategy {
11 private readonly options;
12 readonly transportId = Transport.TCP;
13 protected server: NetSocket;
14 private readonly port;
15 private readonly host;
16 private readonly socketClass;
17 private isExplicitlyTerminated;
18 private retryAttemptsCount;
19 private tlsOptions?;
20 constructor(options: TcpOptions['options']);
21 listen(callback: (err?: unknown, ...optionalParams: unknown[]) => void): void;
22 close(): void;
23 bindHandler(socket: Socket): void;
24 handleMessage(socket: TcpSocket, rawMessage: unknown): Promise<any>;
25 handleClose(): undefined | number | NodeJS.Timer;
26 private init;
27 private getSocketInstance;
28}