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
ILoggerFactorymessageFactory
IMessageFactorymessageServiceFactory
IMessageServiceFactorypingPongServiceFactory
IPingPongServiceFactorysecureKeyManager
ISecureKeyManagertransportServiceFactory
ITransportServiceFactorynodeOptions
IOptions<NodeOptions>
Methods
CreateConnectedPeerAsync(PeerAddress, TcpClient)
Creates a peer that we're connecting to.
public Task<Peer> CreateConnectedPeerAsync(PeerAddress peerAddress, TcpClient tcpClient)
Parameters
peerAddress
PeerAddressPeer address
tcpClient
TcpClientTCP 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