Table of Contents

Class TransportService

Namespace
NLightning.Bolts.BOLT8.Services
Assembly
NLightning.Bolts.dll
public sealed class TransportService : ITransportService, IDisposable
Inheritance
TransportService
Implements
Inherited Members

Constructors

TransportService(bool, ReadOnlySpan<byte>, ReadOnlySpan<byte>, TcpClient)

public TransportService(bool isInitiator, ReadOnlySpan<byte> s, ReadOnlySpan<byte> rs, TcpClient tcpClient)

Parameters

isInitiator bool
s ReadOnlySpan<byte>
rs ReadOnlySpan<byte>
tcpClient TcpClient

Properties

IsConnected

public bool IsConnected { get; }

Property Value

bool

IsInitiator

public bool IsInitiator { get; }

Property Value

bool

RemoteStaticPublicKey

public PubKey RemoteStaticPublicKey { get; }

Property Value

PubKey

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

~TransportService()

protected ~TransportService()

InitializeAsync(TimeSpan)

public Task InitializeAsync(TimeSpan networkTimeout)

Parameters

networkTimeout TimeSpan

Returns

Task

WriteMessageAsync(IMessage, CancellationToken)

public Task WriteMessageAsync(IMessage message, CancellationToken cancellationToken = default)

Parameters

message IMessage
cancellationToken CancellationToken

Returns

Task

Events

MessageReceived

public event EventHandler<MemoryStream>? MessageReceived

Event Type

EventHandler<MemoryStream>