UNPKG

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