Class NodeConnection<M>

Type Parameters

  • M extends ClientManifest

Hierarchy

  • CreateDestroy
    • NodeConnection

Constructors

  • Type Parameters

    • M extends ClientManifest

    Parameters

    • __namedParameters: {
          certChain: Readonly<X509Certificate>[];
          host: Host;
          hostname?: Hostname;
          localHost: Host;
          localPort: Port;
          logger: Logger;
          nodeId: NodeId;
          port: Port;
          quicClient?: QUICClient;
          quicConnection: QUICConnection;
          rpcClient: RPCClient<M>;
          validatedNodeId: NodeId;
      }
      • certChain: Readonly<X509Certificate>[]
      • host: Host
      • Optional hostname?: Hostname
      • localHost: Host
      • localPort: Port
      • logger: Logger
      • nodeId: NodeId
      • port: Port
      • Optional quicClient?: QUICClient
      • quicConnection: QUICConnection
      • rpcClient: RPCClient<M>
      • validatedNodeId: NodeId

    Returns NodeConnection<M>

Properties

[initLock]: RWLockWriter
certChain: Readonly<X509Certificate>[]
host: Host
hostname?: Hostname

Hostname is defined if the target's host was resolved from this hostname Undefined if a Host was directly provided

localHost: Host
localPort: Port
logger: Logger
nodeId: NodeId

The most current NodeId of the peer's cert chain

port: Port
quicClient: undefined | QUICClient
quicConnection: QUICConnection
rpcClient: RPCClient<M>
validatedNodeId: NodeId

The NodeId that it was validated on when verifying the peer

Accessors

  • get [destroyed](): boolean
  • Returns boolean

  • get [eventHandled](): ReadonlyWeakSet<Event>
  • Returns ReadonlyWeakSet<Event>

  • get [eventHandlers](): ReadonlyMap<string, Set<EventHandlerInfo>>
  • Returns ReadonlyMap<string, Set<EventHandlerInfo>>

  • get [eventTarget](): EventTarget
  • Returns EventTarget

  • get [handleEventError](): ((evt) => void)
  • Returns ((evt) => void)

      • (evt): void
      • Parameters

        • evt: EventError

        Returns void

  • get [statusP](): Promise<Status>
  • Returns Promise<Status>

  • get [status](): Status
  • Returns Status

Methods

  • Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • __namedParameters: {
          force?: boolean;
      } = {}
      • Optional force?: boolean

    Returns Promise<void>

  • Parameters

    • event: Event

    Returns boolean

  • Propagates all events from the QUICClient or QUICConnection upwards. If the QUICClient exists then it is just registered to that, otherwise just the QUICConnection. Will only re-dispatch the event if it's an AbstractEvent.

    Parameters

    • evt: EventAll<Event>

    Returns void

  • Triggers the destruction of the NodeConnection. Since this is only in response to an underlying problem or close it will force destroy. Dispatched by the EventNodeConnectionError event as the EventNodeConnectionError -> EventNodeConnectionClose event path.

    Parameters

    Returns Promise<void>

  • Dispatches a EventNodeConnectionClose in response to any NodeConnection error event. Will trigger destruction of the NodeConnection via the EventNodeConnectionError -> EventNodeConnectionClose event path.

    Parameters

    Returns void

  • Redispatches a QUICStream from a EventQUICConnectionStream event with a EventNodeConnectionStream event. Should bubble upwards through the NodeConnectionManager.

    Parameters

    • evt: EventQUICConnectionStream

    Returns void

  • Redispatches QUICConnection or QUICClient error events as NodeConnection error events. This should trigger the destruction of the NodeConnection through the EventNodeConnectionError -> EventNodeConnectionClose event path.

    Parameters

    • evt: EventQUICConnectionError

    Returns void

  • Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns void

  • Type Parameters

    • M extends ClientManifest

    Parameters

    • __namedParameters: {
          connectionKeepAliveIntervalTime?: number;
          connectionKeepAliveTimeoutTime?: number;
          crypto: ClientCryptoOps;
          logger?: Logger;
          manifest: M;
          quicSocket?: QUICSocket;
          targetHost: Host;
          targetHostname?: Hostname;
          targetNodeIds: NodeId[];
          targetPort: Port;
          tlsConfig: TLSConfig;
      }
      • Optional connectionKeepAliveIntervalTime?: number
      • Optional connectionKeepAliveTimeoutTime?: number
      • crypto: ClientCryptoOps
      • Optional logger?: Logger
      • manifest: M
      • Optional quicSocket?: QUICSocket
      • targetHost: Host
      • Optional targetHostname?: Hostname
      • targetNodeIds: NodeId[]
      • targetPort: Port
      • tlsConfig: TLSConfig
    • Optional ctx: Partial<ContextTimedInput>

    Returns PromiseCancellable<NodeConnection<M>>

  • Type Parameters

    • M extends ClientManifest

    Parameters

    • __namedParameters: {
          certChain: Readonly<X509Certificate>[];
          logger?: Logger;
          manifest: M;
          nodeId: NodeId;
          quicConnection: QUICConnection;
      }
      • certChain: Readonly<X509Certificate>[]
      • Optional logger?: Logger
      • manifest: M
      • nodeId: NodeId
      • quicConnection: QUICConnection

    Returns Promise<NodeConnection<M>>

Generated using TypeDoc