Ejemplo n.º 1
0
        /**
         * Creates a default binding request. The request contains a ChangeReqeust
         * attribute with zero change ip and change port flags.
         * @return a default binding request.
         */
        public static Request CreateBindingRequest()
        {
            Request bindingRequest = new Request();

            try
            {
                bindingRequest.SetMessageType(Message.BINDING_REQUEST);
            }
            catch (StunException ex)
            {
                //there should be no exc here since we're the creators.
                Console.WriteLine("Exception {0} {1}", ex.Message, ex.StackTrace);
            }

            //add a change request attribute
            ChangeRequestAttribute attribute
                = AttributeFactory.CreateChangeRequestAttribute();

            bindingRequest.AddAttribute(attribute);

            return(bindingRequest);
        }
Ejemplo n.º 2
0
        /**
         * Creates a default binding request. The request contains a ChangeReqeust
         * attribute with zero change ip and change port flags.
         * @return a default binding request.
         */
        public static Request CreateBindingRequest()
        {
            Request bindingRequest = new Request();
            try
            {
                bindingRequest.SetMessageType(Message.BINDING_REQUEST);
            }
            catch (StunException ex)
            {
                //there should be no exc here since we're the creators.
                Console.WriteLine("Exception {0} {1}", ex.Message, ex.StackTrace);
            }

            //add a change request attribute
            ChangeRequestAttribute attribute
                = AttributeFactory.CreateChangeRequestAttribute();

            bindingRequest.AddAttribute(attribute);

            return bindingRequest;
        }