///
///
///
import net from "net";
import { EventEmitter } from "stream";
import tls, { TLSSocketOptions } from "tls";
import { PopServerConfig } from "./PopServerConfig";
export declare class PopServer extends EventEmitter {
readonly config: PopServerConfig;
readonly hostname: string;
readonly plain_port: number;
readonly secure_port: number;
readonly backlog: number;
readonly timeout: number;
readonly tls_options: TLSSocketOptions;
protected plain_server: net.Server | null;
protected secure_server: tls.Server | null;
/**
* Constructs a new PopServer.
* @parma config the configuration.
* @param hostname the hostname to listen on.
* @param plain_port the plain port to listen on.
* @param secure_port the secure port to listen on.
* @param backlog the backlog.
* @param timeout the timeout of sockets in ms.
* @param tls_options the tls socket options.
*/
constructor(config: PopServerConfig, hostname?: string, plain_port?: number, secure_port?: number, backlog?: number, timeout?: number, tls_options?: TLSSocketOptions);
/**
* Runs the PopServer.
* @returns ourselves.
*/
run(): PopServer;
/**
* Close sthe PopServer.
* @returns ourselves.
*/
close(): PopServer;
/**
* Gets called when an close event has been emitted.
* @param secure if this is the secure server.
* @param err the possible error.
*/
protected _event_close(secure: boolean, err: Error | undefined): void;
/**
* Gets called when a listening event is emitted.
* @param secure if this is the secure server.
*/
protected _event_listening(secure: boolean): void;
/**
* Gets called when an error event is emitted.
* @param secure if this is the secure server.
* @param err the error.
*/
protected _event_error(secure: boolean, err: Error): void;
/**
* Gets called when a new client has connected.
* @param secure if this is the secure server.
* @param socket the socket.
*/
protected _event_connection(secure: boolean, socket: net.Socket | tls.TLSSocket): void;
}