Writes JSON-RPC messages to an underlying transport.

Hierarchy (View Summary)

Constructors

Accessors

  • get onClose(): Event<void>
  • An event raised when the underlying transport has closed and writing is no longer possible.

    Returns Event<void>

  • get onError(): Event<[Error, undefined | Message, undefined | number]>
  • Raised whenever an error occurs while writing a message.

    Returns Event<[Error, undefined | Message, undefined | number]>

Methods

  • Releases resources incurred from writing or raising events. Does NOT close the underlying transport, if any.

    Returns void

  • Call when the connection using this message writer ends (e.g. MessageConnection.end() is called)

    Returns void

  • Parameters

    • error: any
    • Optionalmessage: Message
    • Optionalcount: number

    Returns void

  • Sends a JSON-RPC message.

    Parameters

    • msg: Message

      The JSON-RPC message to be sent.

    Returns Promise<void>

    Implementations should guarantee messages are transmitted in the same order that they are received by this method.