public void NaturalClose() { if (IsShutDown) { return; } IsShutDown = true; ActiveSocket.Close(); Response.Dispose(); }
public void Dispose() { if (!IsShutDown) { ActiveSocket.Close(); IsShutDown = true; Response.Dispose(); ConnectionHandler.Dispose(); } }
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"); } }