Package 

Class StunClientTransaction

  • All Implemented Interfaces:

    
    public class StunClientTransaction
    
                        

    The StunClientTransaction class retransmits requests as specified by RFC 3489. Once formulated and sent, the client sends the Binding Request. Reliability is accomplished through request retransmissions. The StunClientTransaction retransmits 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.

    • 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

      • 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