Table of Contents

Class BaseMessage

Namespace
NLightning.Bolts.Base
Assembly
NLightning.Bolts.dll

Base class for a message.

public abstract class BaseMessage : IMessage
Inheritance
BaseMessage
Implements
Derived
Inherited Members

Constructors

BaseMessage(ushort)

protected BaseMessage(ushort type)

Parameters

type ushort

BaseMessage(ushort, IMessagePayload, TlvStream?)

protected BaseMessage(ushort type, IMessagePayload payload, TlvStream? extension = null)

Parameters

type ushort
payload IMessagePayload
extension TlvStream

Properties

Extension

The extension of the message, if any.

public TlvStream? Extension { get; protected set; }

Property Value

TlvStream

Payload

The payload of the message.

public virtual IMessagePayload Payload { get; protected set; }

Property Value

IMessagePayload

Type

The type of the message. MessageTypes.

public ushort Type { get; protected set; }

Property Value

ushort

Methods

SerializeAsync(Stream)

Serialize the message to a stream.

public virtual Task SerializeAsync(Stream stream)

Parameters

stream Stream

The stream to serialize to.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

NullReferenceException

Payload must not be null.