|
@@ -140,7 +140,7 @@ namespace EVCB_OCPP.WSServer
|
|
|
smartChargingTask.Start();
|
|
|
|
|
|
|
|
|
- Task denyModelCheckTask = new Task(()=>DenyModelCheckTrigger(false), _ct);
|
|
|
+ Task denyModelCheckTask = new Task(() => DenyModelCheckTrigger(false), _ct);
|
|
|
denyModelCheckTask.Start();
|
|
|
|
|
|
while (true)
|
|
@@ -286,8 +286,17 @@ namespace EVCB_OCPP.WSServer
|
|
|
|
|
|
List<IListenerConfig> llistener = new List<IListenerConfig>();
|
|
|
|
|
|
- llistener.Add(new ListenerConfig { Ip = System.Net.IPAddress.Any.ToString(), Port = Convert.ToInt32(GlobalConfig.GetWS_Port()), Backlog = 100, Security = "None" });
|
|
|
- llistener.Add(new ListenerConfig { Ip = System.Net.IPAddress.Any.ToString(), Port = Convert.ToInt32(GlobalConfig.GetWSS_Port()), Backlog = 100, Security = SslProtocols.Tls12.ToString() });
|
|
|
+ if (GlobalConfig.GetWS_Port() != 0)
|
|
|
+ {
|
|
|
+ llistener.Add(new ListenerConfig { Ip = System.Net.IPAddress.Any.ToString(), Port = GlobalConfig.GetWS_Port(), Backlog = 100, Security = "None" });
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach (var securityport in GlobalConfig.GetWSS_Ports())
|
|
|
+ {
|
|
|
+ llistener.Add(new ListenerConfig { Ip = System.Net.IPAddress.Any.ToString(), Port = securityport, Backlog = 100, Security = SslProtocols.Tls12.ToString() });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
var config = ConfigurationManager.GetSection("superSocket") as IConfigurationSource;
|
|
|
ICertificateConfig Certificate = config.Servers.ElementAt(0).Certificate;
|
|
@@ -997,7 +1006,7 @@ namespace EVCB_OCPP.WSServer
|
|
|
}
|
|
|
|
|
|
async private void DenyModelCheckTrigger(bool warmup)
|
|
|
- {
|
|
|
+ {
|
|
|
for (; ; )
|
|
|
{
|
|
|
if (_ct.IsCancellationRequested)
|
|
@@ -1016,7 +1025,7 @@ namespace EVCB_OCPP.WSServer
|
|
|
string strSql = "SELECT [Value] FROM [dbo].[KernelConfig] " +
|
|
|
"where SystemKey = 'DenyModelNames'; ";
|
|
|
var result = await conn.QueryAsync<string>(strSql);
|
|
|
-
|
|
|
+
|
|
|
GlobalConfig.DenyModelNames = result.FirstOrDefault().Split(',').ToList();
|
|
|
logger.Debug(string.Format("Current DenyList:[{0}]", string.Join(",", GlobalConfig.DenyModelNames)));
|
|
|
}
|
|
@@ -1039,13 +1048,13 @@ namespace EVCB_OCPP.WSServer
|
|
|
RemoveClient(session);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
await Task.Delay(500);
|
|
|
|
|
@@ -1618,9 +1627,9 @@ namespace EVCB_OCPP.WSServer
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- logger.Error("SetDefaultFee",ex.ToString());
|
|
|
+ logger.Error("SetDefaultFee", ex.ToString());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return displayPriceText;
|
|
|
}
|
|
|
|
|
@@ -1855,7 +1864,7 @@ namespace EVCB_OCPP.WSServer
|
|
|
new SqlParameter("EVSEEndPoint",25){ Value=clientData.RemoteEndPoint==null?"123":clientData.RemoteEndPoint.ToString()},
|
|
|
new SqlParameter("Session",36){ Value=clientData.SessionID==null?"123":clientData.SessionID}
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
db.Database.ExecuteSqlCommand(sp, parameter);
|
|
|
}
|
|
|
}
|