Turn.Server.TurnServer.TurnServer_PeerDataReceived C# (CSharp) Method

TurnServer_PeerDataReceived() private method

private TurnServer_PeerDataReceived ( ServerAsyncEventArgs &e ) : void
e SocketServers.ServerAsyncEventArgs
return void
        private void TurnServer_PeerDataReceived(ref ServerAsyncEventArgs e)
        {
            //lock (syncRoot)
            {
                try
                {
                    Allocation allocation = allocations.GetByPeer(e.LocalEndPoint, e.RemoteEndPoint);

                    if (allocation != null)
                    {
                        allocation.TouchLifetime();

                        if (allocation.IsActiveDestinationEnabled)
                        {
                            e.LocalEndPoint = allocation.Alocated;
                            e.RemoteEndPoint = allocation.ActiveDestination;
                            e.Count = e.BytesTransferred;
                            e.ConnectionId = ServerAsyncEventArgs.AnyNewConnectionId;

                            peerServer.SendAsync(e);

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