Beispiel #1
0
        static void Main(string[] args)
        {
            using ItzContext db = new ItzContext();
            db.Database.EnsureCreated();
            AuthHandler handler = new AuthHandler(db);
            var         server  = new WebSocketServer("ws://0.0.0.0:811");

            server.AddWebSocketService("/chat", () => new ChatServer(handler, db));
            server.Start();
            Console.ReadKey();
            server.Stop();
        }
Beispiel #2
0
 public ChatServer(AuthHandler auth, ItzContext db) : base()
 {
     this.auth = auth;
     this.db   = db;
 }