Table of Contents

Class PeerFactory

Namespace
NLightning.Infrastructure.Node.Factories
Assembly
NLightning.Infrastructure.dll
public class PeerFactory : IPeerFactory
Inheritance
PeerFactory
Implements
Inherited Members

Constructors

PeerFactory(ILoggerFactory, IMessageFactory, IMessageServiceFactory, IPingPongServiceFactory, ISecureKeyManager, ITransportServiceFactory, IOptions<NodeOptions>)

public PeerFactory(ILoggerFactory loggerFactory, IMessageFactory messageFactory, IMessageServiceFactory messageServiceFactory, IPingPongServiceFactory pingPongServiceFactory, ISecureKeyManager secureKeyManager, ITransportServiceFactory transportServiceFactory, IOptions<NodeOptions> nodeOptions)

Parameters

loggerFactory ILoggerFactory
messageFactory IMessageFactory
messageServiceFactory IMessageServiceFactory
pingPongServiceFactory IPingPongServiceFactory
secureKeyManager ISecureKeyManager
transportServiceFactory ITransportServiceFactory
nodeOptions IOptions<NodeOptions>

Methods

CreateConnectedPeerAsync(PeerAddress, TcpClient)

Creates a peer that we're connecting to.

public Task<Peer> CreateConnectedPeerAsync(PeerAddress peerAddress, TcpClient tcpClient)

Parameters

peerAddress PeerAddress

Peer address

tcpClient TcpClient

TCP client

Returns

Task<Peer>

A task that represents the asynchronous operation. The task result contains the created peer.

Exceptions

ConnectionException

Thrown when the connection to the peer fails.

CreateConnectingPeerAsync(TcpClient)

public Task<Peer> CreateConnectingPeerAsync(TcpClient tcpClient)

Parameters

tcpClient TcpClient

Returns

Task<Peer>