-
- All Implemented Interfaces:
public class StunClientTransactionThe
StunClientTransactionclass retransmits requests as specified by RFC 3489. Once formulated and sent, the client sends the Binding Request. Reliability is accomplished through request retransmissions. TheStunClientTransactionretransmits the request starting with an interval of 100ms, doubling every retransmit until the interval reaches 1.6s. Retransmissions continue with intervals of 1.6s until a response is received, or a total of 9 requests have been sent. If no response is received by 1.6 seconds after the last request has been sent, the client SHOULD consider the transaction to have failed. In other words, requests would be sent at times 0ms, 100ms, 300ms, 700ms, 1500ms, 3100ms, 4700ms, 6300ms, and 7900ms. At 9500ms, the client considers the transaction to have failed if no response has been received.
-
-
Field Summary
Fields Modifier and Type Field Description public final static intDEFAULT_MAX_RETRANSMISSIONSpublic final static intDEFAULT_MAX_WAIT_INTERVALpublic final static intDEFAULT_ORIGINAL_WAIT_INTERVALpublic intmaxRetransmissionspublic intoriginalWaitIntervalpublic intmaxWaitIntervalprivate final TransportAddresslocalAddress
-
Constructor Summary
Constructors Constructor Description StunClientTransaction(StunStack stackCallback, Request request, TransportAddress requestDestination, TransportAddress localAddress, ResponseCollector responseCollector)Creates a client transaction. StunClientTransaction(StunStack stackCallback, Request request, TransportAddress requestDestination, TransportAddress localAddress, ResponseCollector responseCollector, TransactionID transactionID)Creates a client transaction.
-
Method Summary
Modifier and Type Method Description TransportAddressgetLocalAddress()Returns the local TransportAddress that this transaction is sending requests from. voidhandleResponse(StunMessageEvent evt)Dispatches the response then cancels itself and notifies the StunStack for its termination. TransportAddressgetRemoteAddress()Returns the remote TransportAddress that this transaction is sending requests to. -
-
Constructor Detail
-
StunClientTransaction
StunClientTransaction(StunStack stackCallback, Request request, TransportAddress requestDestination, TransportAddress localAddress, ResponseCollector responseCollector)
Creates a client transaction.- Parameters:
stackCallback- the stack that created us.request- the request that we are living for.requestDestination- the destination of the request.localAddress- the local TransportAddress this transaction will be communication through.responseCollector- the instance that should receive this request's response retransmit.
-
StunClientTransaction
StunClientTransaction(StunStack stackCallback, Request request, TransportAddress requestDestination, TransportAddress localAddress, ResponseCollector responseCollector, TransactionID transactionID)
Creates a client transaction.- Parameters:
stackCallback- the stack that created us.request- the request that we are living for.requestDestination- the destination of the request.localAddress- the local TransportAddress this transaction will be communication through.responseCollector- the instance that should receive this request's response retransmit.transactionID- the ID that we'd like the new transaction to have in case the application created it in order to use it for application data correlation.
-
-
Method Detail
-
getLocalAddress
TransportAddress getLocalAddress()
Returns the local TransportAddress that this transaction is sending requests from.
-
handleResponse
void handleResponse(StunMessageEvent evt)
Dispatches the response then cancels itself and notifies the StunStack for its termination.
- Parameters:
evt- the event that contains the newly received message
-
getRemoteAddress
TransportAddress getRemoteAddress()
Returns the remote TransportAddress that this transaction is sending requests to.
-
-
-
-