Protected
actionOptional
clientProtected
Optional
clientOnce the server starts actively with first RPC action for the client, a RPC connection is created.
Protected
messageProtected
peerOptional
peerFor peer->client(us) communication. This is automatically created when registerAsPeer is called. Set this property earlier to work with a custom RpcKernel.
Protected
peerProtected
Optional
registeredProtected
repliesReadonly
tokenProtected
transportReadonly
transporterOptional
usernameOptional
dontOptional
timeout?: numberOptional
typePer default entity types with a name (@entity.name()) will be reused. If a entity with a given name was not loaded and error is thrown. This to ensure nominal typing (object instanceof T). Use this method to disable this behavior and construct new nominal types if an entity is not loaded.
Protected
onThe 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);
}
Protected
onProtected
onCreates a new peer connection, or re-uses an existing non-disconnected one.
Make sure to call disconnect() on it once you're done using it, otherwise the peer will leak memory. (connection will be dropped if idle for too long automatically tough)
Registers a new controller for the server's RPC kernel. This is when the server wants to communicate actively with the client (us).
Registers a new controller for the peer's RPC kernel.
Use registerAsPeer
first.
Optional
body: TOptional
schema: ReceiveType<T>Optional
connectionOptional
dontOptional
peerOptional
timeout?: numberGenerated using TypeDoc
For server->client (us) communication. This is automatically created when registerController is called. Set this property earlier to work with a custom RpcKernel.