示例#1
0
        /**
         * Sends the specified request through the specified access point, and
         * registers the specified ResponseCollector for later notification.
         * @param  request     the request to send
         * @param  sendTo      the destination address of the request.
         * @param  sendThrough the access point to use when sending the request
         * @param  collector   the instance to notify when a response arrives or the
         *                     the transaction timeouts
         * @throws StunException
         * ILLEGAL_STATE if the stun stack is not started. <br/>
         * ILLEGAL_ARGUMENT if the apDescriptor references an access point that had
         * not been installed <br/>
         * NETWORK_ERROR if an error occurs while sending message bytes through the
         * network socket. <br/>
         *
         */
        public virtual void SendRequest(Request request,
                                        StunAddress sendTo,
                                        NetAccessPointDescriptor sendThrough,
                                        ResponseCollector collector)
        {
            stunStack.CheckStarted();

            StunClientTransaction clientTransaction =
                new StunClientTransaction(this,
                                          request,
                                          sendTo,
                                          sendThrough,
                                          collector);

            clientTransactions[clientTransaction.GetTransactionID()] =
                clientTransaction;
            clientTransaction.SendRequest();
        }
示例#2
0
        /**
         * Sends the specified request through the specified access point, and
         * registers the specified ResponseCollector for later notification.
         * @param  request     the request to send
         * @param  sendTo      the destination address of the request.
         * @param  sendThrough the access point to use when sending the request
         * @param  collector   the instance to notify when a response arrives or the
         *                     the transaction timeouts
         * @throws StunException
         * ILLEGAL_STATE if the stun stack is not started. <br/>
         * ILLEGAL_ARGUMENT if the apDescriptor references an access point that had
         * not been installed <br/>
         * NETWORK_ERROR if an error occurs while sending message bytes through the
         * network socket. <br/>

         */
        public virtual void SendRequest( Request                  request,
			StunAddress              sendTo,
			NetAccessPointDescriptor sendThrough,
			ResponseCollector        collector )
        {
            stunStack.CheckStarted();

            StunClientTransaction clientTransaction =
                new StunClientTransaction(this,
                request,
                sendTo,
                sendThrough,
                collector);

            clientTransactions[clientTransaction.GetTransactionID()] =
                clientTransaction;
            clientTransaction.SendRequest();
        }
示例#3
0
 /**
  * Removes a client transaction from this providers client transactions list.
  * Method is used by ClientStunTransaction-s themselves when a timeout occurs.
  * @param tran the transaction to remove.
  */
 public void RemoveClientTransaction(StunClientTransaction tran)
 {
     clientTransactions.Remove(tran.GetTransactionID());
 }
示例#4
0
 /**
  * Removes a client transaction from this providers client transactions list.
  * Method is used by ClientStunTransaction-s themselves when a timeout occurs.
  * @param tran the transaction to remove.
  */
 public void RemoveClientTransaction(StunClientTransaction tran)
 {
     clientTransactions.Remove(tran.GetTransactionID());
 }