UNPKG

1.02 kBTypeScriptView Raw
1import { ConnectionOptions } from 'tls';
2import { TcpSocket } from '../helpers';
3import { ReadPacket, WritePacket } from '../interfaces';
4import { TcpClientOptions } from '../interfaces/client-metadata.interface';
5import { ClientProxy } from './client-proxy';
6/**
7 * @publicApi
8 */
9export declare class ClientTCP extends ClientProxy {
10 protected connection: Promise<any>;
11 private readonly logger;
12 private readonly port;
13 private readonly host;
14 private readonly socketClass;
15 private isConnected;
16 private socket;
17 tlsOptions?: ConnectionOptions;
18 constructor(options: TcpClientOptions['options']);
19 connect(): Promise<any>;
20 handleResponse(buffer: unknown): Promise<void>;
21 createSocket(): TcpSocket;
22 close(): void;
23 bindEvents(socket: TcpSocket): void;
24 handleError(err: any): void;
25 handleClose(): void;
26 protected publish(partialPacket: ReadPacket, callback: (packet: WritePacket) => any): () => void;
27 protected dispatchEvent(packet: ReadPacket): Promise<any>;
28}