Create a ConnectionHandler that just echoes its packets.

  • Parameters

    Returns ((...args: []) => GuardedKit<{
        handler: {
            onClose(_connection: Connection, reason?: any, _connectionHandler?: ConnectionHandler): Promise<void>;
            onReceive(_connection: Connection, bytes: string, _connectionHandler: ConnectionHandler): Promise<string>;
        };
        listener: {
            onAccept(_port: any, _localAddr: any, _remoteAddr: any, _listenHandler: any): Promise<Guarded<{
                onClose(_connection: Connection, reason?: any, _connectionHandler?: ConnectionHandler): Promise<void>;
                onReceive(_connection: Connection, bytes: string, _connectionHandler: ConnectionHandler): Promise<string>;
            }>>;
            onListen(port: any, _listenHandler: any): Promise<void>;
        };
    }>)

      • (...args): GuardedKit<{
            handler: {
                onClose(_connection: Connection, reason?: any, _connectionHandler?: ConnectionHandler): Promise<void>;
                onReceive(_connection: Connection, bytes: string, _connectionHandler: ConnectionHandler): Promise<string>;
            };
            listener: {
                onAccept(_port: any, _localAddr: any, _remoteAddr: any, _listenHandler: any): Promise<Guarded<{
                    onClose(_connection: Connection, reason?: any, _connectionHandler?: ConnectionHandler): Promise<void>;
                    onReceive(_connection: Connection, bytes: string, _connectionHandler: ConnectionHandler): Promise<string>;
                }>>;
                onListen(port: any, _listenHandler: any): Promise<void>;
            };
        }>
      • Parameters

        • Rest...args: []

        Returns GuardedKit<{
            handler: {
                onClose(_connection: Connection, reason?: any, _connectionHandler?: ConnectionHandler): Promise<void>;
                onReceive(_connection: Connection, bytes: string, _connectionHandler: ConnectionHandler): Promise<string>;
            };
            listener: {
                onAccept(_port: any, _localAddr: any, _remoteAddr: any, _listenHandler: any): Promise<Guarded<{
                    onClose(_connection: Connection, reason?: any, _connectionHandler?: ConnectionHandler): Promise<void>;
                    onReceive(_connection: Connection, bytes: string, _connectionHandler: ConnectionHandler): Promise<string>;
                }>>;
                onListen(port: any, _listenHandler: any): Promise<void>;
            };
        }>