Interface IPeerService
- Namespace
- NLightning.Domain.Node.Interfaces
- Assembly
- NLightning.Domain.dll
Interface for the peer application service.
public interface IPeerService : IDisposable
- Inherited Members
Properties
Features
Gets the feature options for the peer.
FeatureOptions Features { get; }
Property Value
PeerPubKey
Gets the peer's public key.
CompactPubKey PeerPubKey { get; }
Property Value
PreferredHost
string? PreferredHost { get; }
Property Value
PreferredPort
ushort? PreferredPort { get; }
Property Value
Methods
Disconnect(Exception?)
Disconnects from the peer.
void Disconnect(Exception? exception = null)
Parameters
exceptionExceptionThe exception that caused the disconnection, if any.
SendMessageAsync(IChannelMessage)
Sends an asynchronous message to the peer.
Task SendMessageAsync(IChannelMessage replyMessage)
Parameters
replyMessageIChannelMessageThe message to be sent to the peer.
Returns
- Task
A task that represents the asynchronous operation.
SendWarningAsync(WarningException)
Sends a warning message to the peer.
Task SendWarningAsync(WarningException we)
Parameters
weWarningExceptionThe warning exception containing the warning message to be sent to the peer.
Returns
- Task
A task that represents the asynchronous operation.
Events
OnAttentionMessageReceived
Occurs when an Error or Warning message is received from the connected peer.
event EventHandler<AttentionMessageEventArgs>? OnAttentionMessageReceived
Event Type
OnChannelMessageReceived
Occurs when a channel message is received from the connected peer.
event EventHandler<ChannelMessageEventArgs> OnChannelMessageReceived
Event Type
OnDisconnect
Event raised when the peer is disconnected.
event EventHandler<PeerDisconnectedEventArgs> OnDisconnect
Event Type
OnExceptionRaised
Occurs when an exception is raised during peer communication.
event EventHandler<Exception>? OnExceptionRaised