Class DeepkitClient

Deprecated

use RpcWebSocketClient instead

Hierarchy

Constructors

Properties

actionClient: RpcActionClient = ...
clientKernel?: RpcKernel

For server->client (us) communication. This is automatically created when registerController is called. Set this property earlier to work with a custom RpcKernel.

clientKernelConnection?: RpcKernelConnection

Once the server starts actively with first RPC action for the client, a RPC connection is created.

events: Subject<RpcClientEvent> = ...
messageId: number = 1
peerConnections: Map<string, RpcClientPeer> = ...
peerKernel?: RpcKernel

For peer->client(us) communication. This is automatically created when registerAsPeer is called. Set this property earlier to work with a custom RpcKernel.

peerKernelConnection: Map<string, RpcKernelConnection> = ...
registeredAsPeer?: string
replies: Map<number, ((message: RpcMessage) => void)> = ...
token: RpcClientToken = ...
typeReuseDisabled: boolean = false
username?: string

Methods

  • The connection process is only finished when this method resolves and doesn't throw. When an error is thrown, the authentication was unsuccessful.

    If you use controllers in this callback, make sure to use dontWaitForConnection=true, otherwise you get an endless loop.

    async onAuthenticate(): Promise<void> {
    const auth = this.controller<AuthController>('auth', {dontWaitForConnection: true});
    const result = auth.login('username', 'password');
    if (!result) throw new AuthenticationError('Authentication failed);
    }

    Returns Promise<void>

  • Type Parameters

    • T

    Parameters

    • type: number
    • Optional body: T
    • Optional schema: ReceiveType<T>
    • options: {
          connectionId?: number;
          dontWaitForConnection?: boolean;
          peerId?: string;
          timeout?: number;
      } = {}
      • Optional connectionId?: number
      • Optional dontWaitForConnection?: boolean
      • Optional peerId?: string
      • Optional timeout?: number

    Returns RpcMessageSubject

Generated using TypeDoc