Table of Contents

Interface IMessageService

Namespace
NLightning.Domain.Protocol.Services
Assembly
NLightning.Domain.dll

Interface for a message service.

public interface IMessageService : IDisposable
Inherited Members

Remarks

This interface is used to send and receive messages.

Properties

IsConnected

Gets a value indicating whether the transport service is connected.

bool IsConnected { get; }

Property Value

bool

Methods

SendMessageAsync(IMessage, CancellationToken)

Sends a message.

Task SendMessageAsync(IMessage message, CancellationToken cancellationToken = default)

Parameters

message IMessage

The message to send.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A task that represents the asynchronous operation.

Events

ExceptionRaised

Event that is raised when an exception is raised.

event EventHandler<Exception>? ExceptionRaised

Event Type

EventHandler<Exception>

MessageReceived

Event that is raised when a message is received.

event EventHandler<IMessage?>? MessageReceived

Event Type

EventHandler<IMessage>