public Client(WebServer server, Socket socket) { ClientServer = server; ClientSocket = socket; ClientSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, ReceiveTimeout); Buffer = ""; }
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(); }
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(); }
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(); }