Пример #1
0
        public bool Connect()
        {
            Debug.WriteLine("Client: Connection " + Server.endPoint.Address.ToString() + " " + iPort);

            try
            {
                ShouldBeRunning = true;
                inputThread     = new Thread(new ThreadStart(inputWorker));
                inputThread.Start();
                client = new TcpEventClient();
                client.PacketReceived += new Helper.Handlers.PacketReceivedEH(PacketReceived);
                client.Disconnected   += new Handlers.voidEH(client_ThisClientDisconnectedFromServer);
                connected              = client.Connect(Server.endPoint);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Comm Client Error..... " + ex.Message);
                connected = false;
            }

            return(connected);
        }
Пример #2
0
        public bool Connect()
        {
            Debug.WriteLine("Client: Connection " + Server.endPoint.Address.ToString() + " " + iPort);

            try
            {
                ShouldBeRunning = true;
                inputThread = new Thread(new ThreadStart(inputWorker));
                inputThread.Start();
                client = new TcpEventClient();
                client.PacketReceived += new Helper.Handlers.PacketReceivedEH(PacketReceived);
                client.Disconnected += new Handlers.voidEH(client_ThisClientDisconnectedFromServer);
                connected = client.Connect(Server.endPoint);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Comm Client Error..... " + ex.Message);
                connected = false;
            }

            return connected;
        }