HttpServer.HttpServer.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
        public void Start()
        {
            m_listener.Start();
            m_listener.BeginGetContext(OnGetContext, null);
            Log.Succes("HttpServer.Start", "HTTP server started");
        }

Usage Example

Exemplo n.º 1
0
        public void StartServers()
        {
            ServerSettings settings = ServiceRegistration.Get <ISettingsManager>().Load <ServerSettings>();

            if (settings.UseIPv4)
            {
                try
                {
                    _httpServerV4.Start(IPAddress.Any, settings.HttpServerPort);
                    ServiceRegistration.Get <ILogger>().Info("ResourceServer: Started HTTP server (IPv4) at port {0}", _httpServerV4.Port);
                }
                catch (SocketException e)
                {
                    ServiceRegistration.Get <ILogger>().Warn("ResourceServer: Error starting HTTP server (IPv4)", e);
                }
            }
            if (settings.UseIPv6)
            {
                try
                {
                    _httpServerV6.Start(IPAddress.IPv6Any, settings.HttpServerPort);
                    ServiceRegistration.Get <ILogger>().Info("ResourceServer: Started HTTP server (IPv6) at port {0}", _httpServerV6.Port);
                }
                catch (SocketException e)
                {
                    ServiceRegistration.Get <ILogger>().Warn("ResourceServer: Error starting HTTP server (IPv6)", e);
                }
            }
        }
All Usage Examples Of HttpServer.HttpServer::Start