mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-01-11 19:44:44 +00:00
Changes the conditions under which the server would restart.
This commit is contained in:
BIN
._Readme.md
Normal file
BIN
._Readme.md
Normal file
Binary file not shown.
@@ -403,8 +403,7 @@ namespace PepperDash.Core
|
||||
ErrorLog.Warn(string.Format("Server '{0}': No Shared Key set", Key));
|
||||
return;
|
||||
}
|
||||
if (IsListening)
|
||||
return;
|
||||
|
||||
|
||||
if (SecureServer == null)
|
||||
{
|
||||
@@ -416,18 +415,14 @@ namespace PepperDash.Core
|
||||
}
|
||||
else
|
||||
{
|
||||
//KillServer(); Remove this to be able to reactivate listener if it stops itself due to max clients without disconnecting connected clients.
|
||||
SecureServer.PortNumber = Port;
|
||||
}
|
||||
ServerStopped = false;
|
||||
SecureServer.WaitForConnectionAsync(IPAddress.Any, SecureConnectCallback);
|
||||
OnServerStateChange(SecureServer.State);
|
||||
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Secure Server Status: {0}, Socket Status: {1}", SecureServer.State, SecureServer.ServerSocketStatus);
|
||||
|
||||
// StartMonitorClient();
|
||||
|
||||
|
||||
ServerCCSection.Leave();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -678,9 +673,12 @@ namespace PepperDash.Core
|
||||
try
|
||||
{
|
||||
|
||||
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "SecureServerSocketStatusChange Index:{0} status:{1} Port:{2} IP:{3}", clientIndex, serverSocketStatus, this.SecureServer.GetPortNumberServerAcceptedConnectionFromForSpecificClient(clientIndex), this.SecureServer.GetLocalAddressServerAcceptedConnectionFromForSpecificClient(clientIndex));
|
||||
|
||||
// Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "SecureServerSocketStatusChange Index:{0} status:{1} Port:{2} IP:{3}", clientIndex, serverSocketStatus, this.SecureServer.GetPortNumberServerAcceptedConnectionFromForSpecificClient(clientIndex), this.SecureServer.GetLocalAddressServerAcceptedConnectionFromForSpecificClient(clientIndex));
|
||||
if (serverSocketStatus != SocketStatus.SOCKET_STATUS_CONNECTED)
|
||||
{
|
||||
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "SecureServerSocketStatusChange ConnectedCLients: {0} ServerState: {1} Port: {2}", SecureServer.NumberOfClientsConnected, SecureServer.State, SecureServer.PortNumber);
|
||||
|
||||
if (ConnectedClientsIndexes.Contains(clientIndex))
|
||||
ConnectedClientsIndexes.Remove(clientIndex);
|
||||
if (HeartbeatRequired && HeartbeatTimerDictionary.ContainsKey(clientIndex))
|
||||
@@ -693,7 +691,7 @@ namespace PepperDash.Core
|
||||
ClientReadyAfterKeyExchange.Remove(clientIndex);
|
||||
if (WaitingForSharedKey.Contains(clientIndex))
|
||||
WaitingForSharedKey.Remove(clientIndex);
|
||||
if (SecureServer.MaxNumberOfClientSupported > SecureServer.NumberOfClientsConnected && SecureServer.State == ServerState.SERVER_NOT_LISTENING)
|
||||
if (SecureServer.MaxNumberOfClientSupported > SecureServer.NumberOfClientsConnected)
|
||||
{
|
||||
Listen();
|
||||
}
|
||||
@@ -797,6 +795,7 @@ namespace PepperDash.Core
|
||||
{
|
||||
if (numberOfBytesReceived > 0)
|
||||
{
|
||||
|
||||
string received = "Nothing";
|
||||
var handler = TextReceivedQueueInvoke;
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user