Beispiel #1
0
 public Client(Server server, Socket sock)
 {
     this.server = server;
     this.sock = sock;
     this.pending = new Queue<Message>();
     this.handler = new Thread(new ThreadStart(this.HandleConnection));
     handler.Start();
 }
Beispiel #2
0
 public Room(Server server, byte id, string name)
 {
     this.server = server;
     this.id = id;
     this.name = name;
     clients = new List<Client>();
     pending = new Queue<Message>();
     posterWait = new ManualResetEvent(true);
     poster = new Thread(new ThreadStart(PostMessages));
     poster.Start();
 }
Beispiel #3
0
 public static void Main(string[] args)
 {
     Server svr = new Server();
     svr.Run();
 }
Beispiel #4
0
 public Room CreateAndAdd(Server svr, string name)
 {
     if (IsFull) return null;
     Room room = new Room(svr, firstOpenId, name);
     Add(room);
     return room;
 }
Beispiel #5
0
 public MsgWindow()
 {
     server = new Server(this);
     client = new Client();
     InitializeComponent();
 }