Class TcpTransport
Assembly: Libplanet.dll
Syntax
public class TcpTransport : object, ITransport, IDisposable
Constructors
|
Improve this Doc
View Source
TcpTransport(RoutingTable, PrivateKey, AppProtocolVersion, Nullable<IImmutableSet<PublicKey>>, Nullable<String>, Nullable<Int32>, IEnumerable<IceServer>, DifferentAppProtocolVersionEncountered, Int32, Nullable<TimeSpan>)
Declaration
public TcpTransport(RoutingTable table, PrivateKey privateKey, AppProtocolVersion appProtocolVersion, IImmutableSet<PublicKey>? trustedAppProtocolVersionSigners, string? host, int? listenPort, IEnumerable<IceServer> iceServers, DifferentAppProtocolVersionEncountered differentAppProtocolVersionEncountered, int minimumBroadcastTarget, TimeSpan? messageLifespan = null)
Parameters
Fields
|
Improve this Doc
View Source
MagicCookie
Declaration
public static readonly byte[] MagicCookie
Field Value
Properties
|
Improve this Doc
View Source
AsPeer
Declaration
public Peer AsPeer { get; }
Property Value
|
Improve this Doc
View Source
LastMessageTimestamp
Declaration
public DateTimeOffset? LastMessageTimestamp { get; }
Property Value
| Type |
Description |
| Nullable<DateTimeOffset> |
Gets the value indicates whether the instance is running.
|
|
Improve this Doc
View Source
ProcessMessageHandler
Declaration
public AsyncDelegate<Message> ProcessMessageHandler { get; }
Property Value
|
Improve this Doc
View Source
Running
Declaration
public bool Running { get; }
Property Value
Methods
|
Improve this Doc
View Source
BroadcastMessage(Nullable<Address>, Message)
Declaration
public void BroadcastMessage(Address? except, Message message)
Parameters
|
Improve this Doc
View Source
Dispose()
Declaration
|
Improve this Doc
View Source
ReplyMessageAsync(Message, CancellationToken)
Declaration
public async Task ReplyMessageAsync(Message message, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| Message |
message |
|
| CancellationToken |
cancellationToken |
|
Returns
|
Improve this Doc
View Source
SendMessageAsync(BoundPeer, Message, CancellationToken)
Declaration
public Task SendMessageAsync(BoundPeer peer, Message message, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| BoundPeer |
peer |
|
| Message |
message |
|
| CancellationToken |
cancellationToken |
|
Returns
|
Improve this Doc
View Source
SendMessageWithReplyAsync(BoundPeer, Message, Nullable<TimeSpan>, CancellationToken)
Declaration
public async Task<Message> SendMessageWithReplyAsync(BoundPeer peer, Message message, TimeSpan? timeout, CancellationToken cancellationToken)
Parameters
Returns
|
Improve this Doc
View Source
SendMessageWithReplyAsync(BoundPeer, Message, Nullable<TimeSpan>, Int32, Boolean, CancellationToken)
Declaration
public async Task<IEnumerable<Message>> SendMessageWithReplyAsync(BoundPeer peer, Message message, TimeSpan? timeout, int expectedResponses, bool returnWhenTimeout, CancellationToken cancellationToken = null)
Parameters
Returns
| Type |
Description |
| Task<IEnumerable<Message>> |
|
|
Improve this Doc
View Source
StartAsync(CancellationToken)
Initiates and runs transport layer.
Declaration
public async Task StartAsync(CancellationToken cancellationToken = null)
Parameters
| Type |
Name |
Description |
| CancellationToken |
cancellationToken |
A cancellation token used to propagate notification that this
operation should be canceled.
|
Returns
| Type |
Description |
| Task |
An awaitable task without value.
|
|
Improve this Doc
View Source
StopAsync(TimeSpan, CancellationToken)
Declaration
public async Task StopAsync(TimeSpan waitFor, CancellationToken cancellationToken = null)
Parameters
| Type |
Name |
Description |
| TimeSpan |
waitFor |
|
| CancellationToken |
cancellationToken |
|
Returns
|
Improve this Doc
View Source
WaitForRunningAsync()
Waits until this ITransport instance gets started to run.
Declaration
public Task WaitForRunningAsync()
Returns
| Type |
Description |
| Task |
A completed when Running
property becomes true.
|
Implements
IDisposable