Turn.Server.TurnServer.ProcessSendRequest C# (CSharp) Метод

ProcessSendRequest() приватный Метод

private ProcessSendRequest ( Allocation allocation, Turn.Message.TurnMessage request, ServerAsyncEventArgs &e ) : Turn.Message.TurnMessage
allocation Allocation
request Turn.Message.TurnMessage
e SocketServers.ServerAsyncEventArgs
Результат Turn.Message.TurnMessage
        private TurnMessage ProcessSendRequest(Allocation allocation, TurnMessage request, ref ServerAsyncEventArgs e)
        {
            try
            {
                if (allocation == null)
                    throw new TurnServerException(ErrorCode.NoBinding);

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

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

                e.LocalEndPoint = allocation.Alocated;
                e.RemoteEndPoint = request.DestinationAddress.IpEndPoint;
                e.Offset = request.Data.ValueRefOffset;
                e.Count = request.Data.ValueRefLength;
                e.ConnectionId = ServerAsyncEventArgs.AnyNewConnectionId;

                peerServer.SendAsync(e);

                e = null;
            }
            catch (Exception ex)
            {
                logger.WriteWarning(ex.ToString());
            }

            // [MS-TURN] The server MUST NOT respond to a client with either
            // a Send response or a Send error response.
            return null;
        }