Table of Contents

Class PeerService

Namespace
NLightning.Bolts.BOLT1.Services
Assembly
NLightning.Bolts.dll

Service for managing peers.

public sealed class PeerService : IPeerService
Inheritance
PeerService
Implements
Inherited Members

Remarks

This class is used to manage peers in the network.

Constructors

PeerService(NodeOptions, ITransportServiceFactory, IPingPongServiceFactory, IMessageServiceFactory)

Service for managing peers.

public PeerService(NodeOptions nodeOptions, ITransportServiceFactory transportServiceFactory, IPingPongServiceFactory pingPongServiceFactory, IMessageServiceFactory messageServiceFactory)

Parameters

nodeOptions NodeOptions

The node options.

transportServiceFactory ITransportServiceFactory

The transport service factory.

pingPongServiceFactory IPingPongServiceFactory

The ping pong service factory.

messageServiceFactory IMessageServiceFactory

The message service factory.

Remarks

This class is used to manage peers in the network.

See Also

Methods

AcceptPeerAsync(TcpClient)

Accepts a peer.

public Task AcceptPeerAsync(TcpClient tcpClient)

Parameters

tcpClient TcpClient

The TCP client.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

ErrorException

Thrown when the connection to the peer fails.

ConnectToPeerAsync(PeerAddress)

Connects to a peer.

public Task ConnectToPeerAsync(PeerAddress peerAddress)

Parameters

peerAddress PeerAddress

The peer address to connect to.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

ConnectionException

Thrown when the connection to the peer fails.

See Also