Пример #1
0
 public void NaturalClose()
 {
     if (IsShutDown)
     {
         return;
     }
     IsShutDown = true;
     ActiveSocket.Close();
     Response.Dispose();
 }
Пример #2
0
 public void Dispose()
 {
     if (!IsShutDown)
     {
         ActiveSocket.Close();
         IsShutDown = true;
         Response.Dispose();
         ConnectionHandler.Dispose();
     }
 }
Пример #3
0
        IEnumerable <string> NetworkStats()
        {
            yield return("Active: " + IsActive);

            if (IsActive)
            {
                yield return("Host: " + IsHost);

                foreach (NetworkConnection connection in ActiveSocket.ActiveConnections())
                {
                    string connectionStat = connection.FriendlyName + " " + connection.ConnectionID.ToString();
                    connectionStat += " : " + connection.CurrentState;
                    //connectionStat += " (" + NetworkTransport.GetCurrentRTT(currentSocket.SocketID, connection.ConnectionID, out error) + "MS)";
                    yield return(connectionStat);
                }


                yield return(ActiveSocket.BytesPerSecond.ToString() + " B/s");

                yield return(ActiveSocket.MessagesPerSecond.ToString() + " M/s");
            }
        }