mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-07-30 17:30:40 +00:00
ASP.Net
This commit is contained in:
@@ -53,6 +53,13 @@ public abstract class NetworkServer<TConnection> : IDestructible where TConnecti
|
||||
|
||||
public event DestroyedEvent OnDestroy;
|
||||
|
||||
protected NetworkServer()
|
||||
{
|
||||
// Connection tracking is also used by externally hosted transports (for example,
|
||||
// ASP.NET Core WebSockets) that don't create an ISocket listener through Start().
|
||||
Connections = new AutoList<TConnection, NetworkServer<TConnection>>(this);
|
||||
}
|
||||
|
||||
|
||||
private void MinuteThread(object state)
|
||||
{
|
||||
@@ -93,8 +100,6 @@ public abstract class NetworkServer<TConnection> : IDestructible where TConnecti
|
||||
if (listener != null)
|
||||
return;
|
||||
|
||||
Connections = new AutoList<TConnection, NetworkServer<TConnection>>(this);
|
||||
|
||||
if (Timeout > 0 && Clock > 0)
|
||||
{
|
||||
timer = new Timer(MinuteThread, null, TimeSpan.FromMinutes(0), TimeSpan.FromSeconds(Clock));
|
||||
@@ -273,7 +278,12 @@ public abstract class NetworkServer<TConnection> : IDestructible where TConnecti
|
||||
finally
|
||||
{
|
||||
try { currentTimer?.Dispose(); } catch { }
|
||||
Global.Log("NetworkServer", LogType.Warning, $"Server on port {port} is down.");
|
||||
if (currentListener != null
|
||||
|| currentTimer != null
|
||||
|| (connections?.Length ?? 0) > 0)
|
||||
{
|
||||
Global.Log("NetworkServer", LogType.Debug, $"Server on port {port} is down.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user