示例#1
0
        static ServerObject server; // сервер

        #endregion Fields

        #region Methods

        static void Main(string[] args)
        {
            try
            {
                server = new ServerObject();
                listenThread = new Thread(new ThreadStart(server.Listen));
                listenThread.Start(); //старт потока
            }
            catch (Exception ex)
            {
                server.Disconnect();
                Console.WriteLine(ex.Message);
            }
            Console.ReadLine();
        }
 public ClientObject(TcpClient tcpClient, ServerObject serverObject)
 {
     client = tcpClient;
     server = serverObject;
     serverObject.AddConnection(this);
 }