Example #1
0
 static Thread listenThread; // потока для прослушивания
 static void Main(string[] args)
 {
     link = new DbLink();
     try
     {
         server       = new ServerObject(link);
         listenThread = new Thread(new ThreadStart(server.Listen));
         listenThread.IsBackground = true;
         listenThread.Start();
     }
     catch (Exception ex)
     {
         server.Disconnect();
         Console.WriteLine(ex.Message);
     }
     Console.ReadKey();
 }
Example #2
0
 public ServerObject(DbLink link)
 {
     clients   = new List <ClientObject>();
     this.link = link;
 }