Exemplo n.º 1
0
 public ComplexServer(IPEndPoint ipEndPoint, int backlog, Encoding encoding)
 {
     _encoding = encoding;
     _binaryFormatter = new BinaryFormatter(encoding);
     _server = new SimpleServer(ipEndPoint, backlog);
     _server.NewConnectionAccepted += ServerNewConnectionAccepted;
     _server.NewMessageReceived += ServerNewMessageReceived;
 }
Exemplo n.º 2
0
 public static SimpleServer Create(string url, Action<HttpListenerContext> handler, AuthenticationSchemes authenticationSchemes = AuthenticationSchemes.Anonymous)
 {
     var listener = new HttpListener
     {
         Prefixes = { url },
         AuthenticationSchemes = authenticationSchemes
     };
     var server = new SimpleServer(listener, handler);
     server.Start();
     return server;
 }