Turn.Server.TurnServer.ProcessSetActiveDestinationRequest C# (CSharp) 메소드

ProcessSetActiveDestinationRequest() 개인적인 메소드

private ProcessSetActiveDestinationRequest ( Allocation allocation, Turn.Message.TurnMessage request, IPEndPoint reflexEndPoint ) : Turn.Message.TurnMessage
allocation Allocation
request Turn.Message.TurnMessage
reflexEndPoint System.Net.IPEndPoint
리턴 Turn.Message.TurnMessage
        private TurnMessage ProcessSetActiveDestinationRequest(Allocation allocation, TurnMessage request, IPEndPoint reflexEndPoint)
        {
            if (allocation == null)
                throw new TurnServerException(ErrorCode.NoBinding);

            if (request.DestinationAddress == null)
                throw new TurnServerException(ErrorCode.BadRequest);

            allocation.ActiveDestination = request.DestinationAddress.IpEndPoint;
            allocation.Permissions.Permit(request.DestinationAddress.IpEndPoint);

            logger.WriteInformation(string.Format("Set Active Destination: {2} --> {0} <--> {1}", allocation.Alocated.ToString(), allocation.Reflexive.ToString(), allocation.ActiveDestination.ToString()));

            uint sequenceNumber = (request.MsSequenceNumber != null) ? request.MsSequenceNumber.SequenceNumber : 0;

            return new TurnMessage()
            {
                IsAttributePaddingDisabled = true,
                MessageType = MessageType.SetActiveDestinationResponse,
                TransactionId = request.TransactionId,

                MagicCookie = new MagicCookie(),

                Realm = new Realm(TurnMessageRfc.MsTurn)
                {
                    Ignore = true,
                    Value = Authentificater.Realm,
                },
                MsUsername = new MsUsername()
                {
                    Ignore = true,
                    Value = request.MsUsername.Value,
                },
                //MsUsername = allocation.Username,
                MessageIntegrity = new MessageIntegrity(),

                MsSequenceNumber = new MsSequenceNumber()
                {
                    ConnectionId = allocation.ConnectionId,
                    SequenceNumber = sequenceNumber,//allocation.SequenceNumber,
                },
            };
        }