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
ushortpayload
IMessagePayloadextension
TlvStream
Properties
Extension
The extension of the message, if any.
public TlvStream? Extension { get; protected set; }
Property Value
Payload
The payload of the message.
public virtual IMessagePayload Payload { get; protected set; }
Property Value
Type
The type of the message. MessageTypes.
public ushort Type { get; protected set; }
Property Value
Methods
SerializeAsync(Stream)
Serialize the message to a stream.
public virtual Task SerializeAsync(Stream stream)
Parameters
stream
StreamThe stream to serialize to.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- NullReferenceException
Payload must not be null.