Show / Hide Table of Contents

Class TurnClient

Inheritance
Object
TurnClient
Implements
IStunContext
IDisposable
Namespace: Libplanet.Stun
Assembly: Libplanet.Stun.dll
Syntax
public class TurnClient : object, IStunContext, IDisposable

Fields

| Improve this Doc View Source

TurnDefaultPort

Declaration
public const int TurnDefaultPort = null
Field Value
Type Description
Int32

Properties

| Improve this Doc View Source

BehindNAT

Declaration
public bool BehindNAT { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

EndPoint

Declaration
public DnsEndPoint EndPoint { get; }
Property Value
Type Description
DnsEndPoint
| Improve this Doc View Source

Nonce

Declaration
public byte[] Nonce { get; }
Property Value
Type Description
Byte[]
| Improve this Doc View Source

Password

Declaration
public string Password { get; }
Property Value
Type Description
String
| Improve this Doc View Source

PublicAddress

Declaration
public IPAddress PublicAddress { get; }
Property Value
Type Description
IPAddress
| Improve this Doc View Source

Realm

Declaration
public string Realm { get; }
Property Value
Type Description
String
| Improve this Doc View Source

Username

Declaration
public string Username { get; }
Property Value
Type Description
String

Methods

| Improve this Doc View Source

AcceptRelayedStreamAsync(CancellationToken)

Declaration
public async Task<NetworkStream> AcceptRelayedStreamAsync(CancellationToken cancellationToken = null)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<NetworkStream>
| Improve this Doc View Source

AllocateRequestAsync(TimeSpan, CancellationToken)

Declaration
public async Task<IPEndPoint> AllocateRequestAsync(TimeSpan lifetime, CancellationToken cancellationToken = null)
Parameters
Type Name Description
TimeSpan lifetime
CancellationToken cancellationToken
Returns
Type Description
Task<IPEndPoint>
| Improve this Doc View Source

Create(IEnumerable<IIceServer>, CancellationToken)

Creates a TurnClient that is connectable to one of the s given.

Declaration
public static async Task<TurnClient> Create(IEnumerable<IIceServer> iceServers, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IEnumerable<IIceServer> iceServers

The list of IIceServers to check.

CancellationToken cancellationToken

A cancellation token used to propagate notification that this operation should be canceled.

Returns
Type Description
Task<TurnClient>

An awaitable that returns TurnClient pointing to a connectable IIceServer.

Remarks

This is a blocking operation with a non-negligable amount of execution time as each in iceServers is checked over the network to see if it can be connected to.

Exceptions
Type Condition
IceServerException

Thrown when no TurnClient can be created that can connect to any IIceServer among iceServers.

| Improve this Doc View Source

CreatePermissionAsync(IPEndPoint, CancellationToken)

Declaration
public async Task CreatePermissionAsync(IPEndPoint peerAddress, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IPEndPoint peerAddress
CancellationToken cancellationToken
Returns
Type Description
Task
| Improve this Doc View Source

Dispose()

Declaration
public void Dispose()
| Improve this Doc View Source

GetMappedAddressAsync(CancellationToken)

Declaration
public async Task<IPEndPoint> GetMappedAddressAsync(CancellationToken cancellationToken = null)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<IPEndPoint>
| Improve this Doc View Source

InitializeTurnAsync(CancellationToken)

Declaration
public async Task InitializeTurnAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task
| Improve this Doc View Source

IsBehindNAT(CancellationToken)

Declaration
public async Task<bool> IsBehindNAT(CancellationToken cancellationToken = null)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<Boolean>
| Improve this Doc View Source

ReconnectTurn(Int32, CancellationToken)

Declaration
public async Task ReconnectTurn(int listenPort, CancellationToken cancellationToken)
Parameters
Type Name Description
Int32 listenPort
CancellationToken cancellationToken
Returns
Type Description
Task
| Improve this Doc View Source

RefreshAllocationAsync(TimeSpan, CancellationToken)

Declaration
public async Task<TimeSpan> RefreshAllocationAsync(TimeSpan lifetime, CancellationToken cancellationToken = null)
Parameters
Type Name Description
TimeSpan lifetime
CancellationToken cancellationToken
Returns
Type Description
Task<TimeSpan>
| Improve this Doc View Source

StartAsync(Int32, CancellationToken)

Declaration
public async Task StartAsync(int listenPort, CancellationToken cancellationToken)
Parameters
Type Name Description
Int32 listenPort
CancellationToken cancellationToken
Returns
Type Description
Task

Implements

IStunContext
IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2022 Planetarium