예제 #1
0
        /// <summary>
        /// Create a new eMIP roaming client for EMPs.
        /// </summary>
        /// <param name="EMPClient">A EMP client.</param>
        /// <param name="EMPServer">A EMP sever.</param>
        public EMPRoaming(EMPClient EMPClient,
                          EMPServer EMPServer)
        {
            this.EMPClient = EMPClient;
            this.EMPServer = EMPServer;

            // Link HTTP events...
            EMPServer.RequestLog  += (HTTPProcessor, ServerTimestamp, Request) => RequestLog.WhenAll(HTTPProcessor, ServerTimestamp, Request);
            EMPServer.ResponseLog += (HTTPProcessor, ServerTimestamp, Request, Response) => ResponseLog.WhenAll(HTTPProcessor, ServerTimestamp, Request, Response);
            EMPServer.ErrorLog    += (HTTPProcessor, ServerTimestamp, Request, Response, Error, LastException) => ErrorLog.WhenAll(HTTPProcessor, ServerTimestamp, Request, Response, Error, LastException);
        }
예제 #2
0
        /// <summary>
        /// Create a new eMIP EMP server logger using the given logging delegates.
        /// </summary>
        /// <param name="EMPServer">A eMIP EMP server.</param>
        /// <param name="LoggingPath">The logging path.</param>
        /// <param name="Context">A context of this API.</param>
        ///
        /// <param name="LogHTTPRequest_toConsole">A delegate to log incoming HTTP requests to console.</param>
        /// <param name="LogHTTPResponse_toConsole">A delegate to log HTTP requests/responses to console.</param>
        /// <param name="LogHTTPRequest_toDisc">A delegate to log incoming HTTP requests to disc.</param>
        /// <param name="LogHTTPResponse_toDisc">A delegate to log HTTP requests/responses to disc.</param>
        ///
        /// <param name="LogHTTPRequest_toNetwork">A delegate to log incoming HTTP requests to a network target.</param>
        /// <param name="LogHTTPResponse_toNetwork">A delegate to log HTTP requests/responses to a network target.</param>
        /// <param name="LogHTTPRequest_toHTTPSSE">A delegate to log incoming HTTP requests to a HTTP server sent events source.</param>
        /// <param name="LogHTTPResponse_toHTTPSSE">A delegate to log HTTP requests/responses to a HTTP server sent events source.</param>
        ///
        /// <param name="LogHTTPError_toConsole">A delegate to log HTTP errors to console.</param>
        /// <param name="LogHTTPError_toDisc">A delegate to log HTTP errors to disc.</param>
        /// <param name="LogHTTPError_toNetwork">A delegate to log HTTP errors to a network target.</param>
        /// <param name="LogHTTPError_toHTTPSSE">A delegate to log HTTP errors to a HTTP server sent events source.</param>
        ///
        /// <param name="LogfileCreator">A delegate to create a log file from the given context and log file name.</param>
        public EMPServerLogger(EMPServer EMPServer,
                               String LoggingPath,
                               String Context,

                               HTTPRequestLoggerDelegate LogHTTPRequest_toConsole,
                               HTTPResponseLoggerDelegate LogHTTPResponse_toConsole,
                               HTTPRequestLoggerDelegate LogHTTPRequest_toDisc,
                               HTTPResponseLoggerDelegate LogHTTPResponse_toDisc,

                               HTTPRequestLoggerDelegate LogHTTPRequest_toNetwork   = null,
                               HTTPResponseLoggerDelegate LogHTTPResponse_toNetwork = null,
                               HTTPRequestLoggerDelegate LogHTTPRequest_toHTTPSSE   = null,
                               HTTPResponseLoggerDelegate LogHTTPResponse_toHTTPSSE = null,

                               HTTPResponseLoggerDelegate LogHTTPError_toConsole = null,
                               HTTPResponseLoggerDelegate LogHTTPError_toDisc    = null,
                               HTTPResponseLoggerDelegate LogHTTPError_toNetwork = null,
                               HTTPResponseLoggerDelegate LogHTTPError_toHTTPSSE = null,

                               LogfileCreatorDelegate LogfileCreator = null)

            : base(EMPServer.SOAPServer.HTTPServer,
                   LoggingPath,
                   Context.IsNotNullOrEmpty() ? Context : DefaultContext,

                   LogHTTPRequest_toConsole,
                   LogHTTPResponse_toConsole,
                   LogHTTPRequest_toDisc,
                   LogHTTPResponse_toDisc,

                   LogHTTPRequest_toNetwork,
                   LogHTTPResponse_toNetwork,
                   LogHTTPRequest_toHTTPSSE,
                   LogHTTPResponse_toHTTPSSE,

                   LogHTTPError_toConsole,
                   LogHTTPError_toDisc,
                   LogHTTPError_toNetwork,
                   LogHTTPError_toHTTPSSE,

                   LogfileCreator)

        {
            this.EMPServer = EMPServer ?? throw new ArgumentNullException(nameof(EMPServer), "The given EMP server must not be null!");

            #region Register remote start/stop log events


            #endregion
        }
예제 #3
0
        /// <summary>
        /// Create a new eMIP EMP server logger using the default logging delegates.
        /// </summary>
        /// <param name="EMPServer">A eMIP EMP server.</param>
        /// <param name="LoggingPath">The logging path.</param>
        /// <param name="Context">A context of this API.</param>
        /// <param name="LogfileCreator">A delegate to create a log file from the given context and log file name.</param>
        public EMPServerLogger(EMPServer EMPServer,
                               String LoggingPath,
                               String Context = DefaultContext,
                               LogfileCreatorDelegate LogfileCreator = null)

            : this(EMPServer,
                   LoggingPath,
                   Context.IsNotNullOrEmpty() ? Context : DefaultContext,
                   null,
                   null,
                   null,
                   null,

                   LogfileCreator : LogfileCreator)

        {
        }
예제 #4
0
 public void Shutdown(String Message = null, Boolean Wait = true)
 {
     EMPServer.Shutdown(Message, Wait);
 }
예제 #5
0
 public void Start()
 {
     EMPServer.Start();
 }