Transactions are used to track Stun requests and correletate them with responses More...
Inherits IDisposable.
Public Member Functions | |
Transaction (Stun.Controller owner, IPEndPoint source, IPEndPoint destination, T request, Action< Transaction< T >> onSuccess=null, Action< Transaction< T >> onTimeout=null, Action< Transaction< T >> onFail=null, int retransmissionTimeout=-1, int maxRetransmissions=3) | |
Construct a new transaction for the provided request Message and onComplete action More... | |
int | RoundTripTime () |
void | StartTimeout () |
void | Cancel () |
void | Complete (T response, IPEndPoint source, IPEndPoint destination, bool success=true) |
void | Dispose () |
Public Attributes | |
readonly Action< Transaction< T > > | onComplete |
The action to call when the request receives a response More... | |
readonly Action< Transaction< T > > | onFail |
readonly Action< Transaction< T > > | onTimeout |
readonly T | request |
The request Message that started this Transaction More... | |
readonly int | maxRetransmissions = 2 |
readonly Stun.Controller | owner |
IPEndPoint | associatedAllocation |
Protected Member Functions | |
virtual void | Dispose (bool disposing) |
Properties | |
IPEndPoint | RequestSource [get] |
IPEndPoint | RequestDestination [get] |
IPEndPoint | ResponseSource [get] |
IPEndPoint | ResponseDestination [get] |
T | Response [get] |
bool | IsComplete [get] |
Transactions are used to track Stun requests and correletate them with responses
When a request Message is sent, a Transaction is created that stores the original request Message as well as an onComplete action to be called when the response is received. When a response is received, the response Message is passed to the onComplete action so that the application can make use of it.
T | : | IMessage |
NobleConnect.Transaction< T >.Transaction | ( | Stun.Controller | owner, |
IPEndPoint | source, | ||
IPEndPoint | destination, | ||
T | request, | ||
Action< Transaction< T >> | onSuccess = null , |
||
Action< Transaction< T >> | onTimeout = null , |
||
Action< Transaction< T >> | onFail = null , |
||
int | retransmissionTimeout = -1 , |
||
int | maxRetransmissions = 3 |
||
) |
Construct a new transaction for the provided request Message and onComplete action
request | |
onSuccess |
void NobleConnect.Transaction< T >.Cancel | ( | ) |
void NobleConnect.Transaction< T >.Complete | ( | T | response, |
IPEndPoint | source, | ||
IPEndPoint | destination, | ||
bool | success = true |
||
) |
void NobleConnect.Transaction< T >.Dispose | ( | ) |
|
protectedvirtual |
int NobleConnect.Transaction< T >.RoundTripTime | ( | ) |
void NobleConnect.Transaction< T >.StartTimeout | ( | ) |
IPEndPoint NobleConnect.Transaction< T >.associatedAllocation |
readonly int NobleConnect.Transaction< T >.maxRetransmissions = 2 |
readonly Action<Transaction<T> > NobleConnect.Transaction< T >.onComplete |
The action to call when the request receives a response
readonly Action<Transaction<T> > NobleConnect.Transaction< T >.onFail |
readonly Action<Transaction<T> > NobleConnect.Transaction< T >.onTimeout |
readonly Stun.Controller NobleConnect.Transaction< T >.owner |
readonly T NobleConnect.Transaction< T >.request |
The request Message that started this Transaction
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |