Interface IPeerService
- Namespace
- NLightning.Domain.Node.Interfaces
- Assembly
- NLightning.Domain.dll
Interface for the peer application service.
public interface IPeerService
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()
Disconnects from the peer.
void Disconnect()
SendMessageAsync(IChannelMessage)
Sends an asynchronous message to the peer.
Task SendMessageAsync(IChannelMessage replyMessage)
Parameters
replyMessage
IChannelMessageThe message to be sent to the peer.
Returns
- Task
A task that represents the asynchronous operation.
Events
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