예제 #1
0
파일: Client.cs 프로젝트: jatowers/Blighttp
 public Client(WebServer server, Socket socket)
 {
     ClientServer = server;
     ClientSocket = socket;
     ClientSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, ReceiveTimeout);
     Buffer = "";
 }
예제 #2
0
        public WebService(Configuration configuration, StatisticsService statisticsService, DatabaseConnectionProvider databaseProvider)
        {
            ProgramConfiguration = configuration;
            ServiceConfiguration = configuration.Web;
            Statistics = statisticsService;
            Server = new WebServer(ServiceConfiguration.Host, ServiceConfiguration.Port, Observe);

            DatabaseProvider = databaseProvider;

            WebServiceProfiler = new Profiler();

            Serialiser = new JavaScriptSerializer();

            LoadChampionNames();
            LoadItemInformation();

            InitialiseHandlers();
        }
예제 #3
0
        public WebService(IGlobalHandler globalHandler, Configuration configuration, StatisticsService statisticsService, Database databaseProvider)
        {
            GlobalHandler = globalHandler;
            ProgramConfiguration = configuration;
            ServiceConfiguration = configuration.Web;
            StatisticsService = statisticsService;
            Server = new WebServer(ServiceConfiguration.Host, ServiceConfiguration.Port, ServiceConfiguration.EnableReverseProxyRealIPMode, this, this);

            DatabaseProvider = databaseProvider;

            WebServiceProfiler = new Profiler();

            Serialiser = new JavaScriptSerializer();

            Views = new HashSet<string>();
            PRNG = new Random();

            LoadIndex();
            InitialiseHandlers();
        }
예제 #4
0
        static void Main(string[] arguments)
        {
            WebServer server = new WebServer("127.0.0.1", 9000);

            Handler container = new Handler("blight");
            server.Add(container);

            Handler markupHandler = new Handler("markup", MarkupTest);
            container.Add(markupHandler);

            Handler exceptionHandler = new Handler("exception", ExceptionTest);
            container.Add(exceptionHandler);

            SubmissionHandler = new Handler("submission", SubmissionTest);
            container.Add(SubmissionHandler);

            Handler chunkedHandler = Handler.ChunkedHandler("chunked", ChunkedTest, ContentType.Markup);
            container.Add(chunkedHandler);

            server.Run();
        }