HttpBenchmarkServer.cs 540 B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Net;
  3. using System.Net.Sockets;
  4. using NetCoreServer;
  5. namespace Benchmarks
  6. {
  7. public class HttpBenchmarkServer : HttpServer
  8. {
  9. public HttpBenchmarkServer(IPAddress address, int port) : base(address, port) { }
  10. protected override TcpSession CreateSession() { return new HttpBenchmarkSession(this); }
  11. protected override void OnError(SocketError error)
  12. {
  13. Console.WriteLine($"HTTP session caught an error: {error}");
  14. }
  15. }
  16. }