UNPKG

node-jet

Version:

Jet Realtime Message Bus for the Web. Daemon and Peer implementation.

26 lines (25 loc) 681 B
import { type Server } from 'net'; import { EventEmitter } from './index.js'; export interface TCPServerConfig { tcpPort?: number; } /** * Class implementation of a TCP server. This implementation only runs in a node.js environment */ export declare class TCPServer extends EventEmitter { config: TCPServerConfig; tcpServer: Server; connectionId: number; /** * Constructor to create a TCP Server instance */ constructor(config: TCPServerConfig); /** * This function starts a TCP server listening on the port specified in the config */ listen(): void; /** * Function to stop the TCP server */ close(): void; }