|
|
@@ -25,7 +25,7 @@ namespace PRSServer
|
|
|
private Timer? CertificateRefreshTimer;
|
|
|
private Timer? CertificateHaltTimer;
|
|
|
private string PipeName;
|
|
|
- private IPCServer? PipeServer;
|
|
|
+ //private IPCServer? PipeServer;
|
|
|
|
|
|
private IRpcServer? _pipeserver;
|
|
|
private IRpcServer? _socketserver;
|
|
|
@@ -202,33 +202,33 @@ namespace PRSServer
|
|
|
CredentialsCache.LoadSessionCache();
|
|
|
CredentialsCache.SetSessionExpiryTime(TimeSpan.FromMinutes(Properties.SessionExpiryTime));
|
|
|
|
|
|
- if (Properties.WebSocketPort != 0)
|
|
|
- {
|
|
|
- // Put a log saying to start the web socket listener.
|
|
|
- Logger.Send(LogType.Information, "", string.Format("Starting Web Socket Listener: Port={0}", Properties.WebSocketPort));
|
|
|
- }
|
|
|
- // This should be out of the if-statement, since the listener needs to be initialised, even if the web socket port is 0.
|
|
|
- RestListener.Init(Properties.WebSocketPort);
|
|
|
- InitialisePort();
|
|
|
- RestListener.Start();
|
|
|
+ // if (Properties.WebSocketPort != 0)
|
|
|
+ // {
|
|
|
+ // // Put a log saying to start the web socket listener.
|
|
|
+ // Logger.Send(LogType.Information, "", string.Format("Starting Web Socket Listener: Port={0}", Properties.WebSocketPort));
|
|
|
+ // }
|
|
|
+ // // This should be out of the if-statement, since the listener needs to be initialised, even if the web socket port is 0.
|
|
|
+ // RestListener.Init(Properties.WebSocketPort);
|
|
|
+ // InitialisePort();
|
|
|
+ // RestListener.Start();
|
|
|
|
|
|
Logger.Send(LogType.Information, "", string.Format("Starting Web Listener: Port={0}", Properties.Port));
|
|
|
|
|
|
- /*var sockettransport = new RpcServerSocketTransport(Properties.Port, CertificateFileName());
|
|
|
- _socketserver = new RpcServer<RpcServerSocketTransport>(() => sockettransport);
|
|
|
+ var sockettransport = new RpcServerSocketTransport(Properties.Port, CertificateFileName());
|
|
|
+ _socketserver = new RpcServer<RpcServerSocketTransport>(sockettransport);
|
|
|
_socketserver.OnLog += (type, userid, message, parameters) => Logger.Send(type, userid, $"[S] {message}", parameters);
|
|
|
_socketserver.Start();
|
|
|
- */
|
|
|
+
|
|
|
Logger.Send(LogType.Information, "", string.Format("Server started listening on port {0}", Properties.Port));
|
|
|
|
|
|
- PipeServer = new IPCServer(PipeName);
|
|
|
- PipeServer.Start();
|
|
|
+ // PipeServer = new IPCServer(PipeName);
|
|
|
+ // PipeServer.Start();
|
|
|
|
|
|
Logger.Send(LogType.Information, "", $"Starting Pipe Listener with pipe name {PipeName}");
|
|
|
- /*var pipetransport = new RpcServerPipeTransport(PipeName);
|
|
|
- _pipeserver = new RpcServer<RpcServerPipeTransport>(() => pipetransport);
|
|
|
+ var pipetransport = new RpcServerPipeTransport(PipeName);
|
|
|
+ _pipeserver = new RpcServer<RpcServerPipeTransport>(pipetransport);
|
|
|
_pipeserver.OnLog += (type, userid, message, parameters) => Logger.Send(type, userid, $"[P] {message}", parameters);
|
|
|
- _pipeserver.Start();*/
|
|
|
+ _pipeserver.Start();
|
|
|
|
|
|
Logger.Send(LogType.Information, "", "Pipe Listener started");
|
|
|
|