Exemplo n.º 1
0
        public void TryConnect()
        {


            try
            {
                XPacket xp = new XPacket();
                m_ServerSocket.BeginConnect(ServerEp, new AsyncCallback(OnConnect), null);
            }
            catch (SocketException se)
            {
                Console.WriteLine(se.Message);
                Messenger.Default.Send<string>("CONNECTION_PROBLEM", "loginform");


            }
        }
Exemplo n.º 2
0
        private void OnConnect(IAsyncResult ar)
        {
            m_ServerSocket.EndConnect(ar);


            Console.WriteLine("Client Connected To The Server...");


            // Login Request Datasını oluşturduk.
            // Şimdi Login Request Datasını Gönderelim.

            XPacket xp = new XPacket();
            m_ServerSocket.BeginReceive(m_Buffer, 0, m_Buffer.Length, SocketFlags.None, new AsyncCallback(OnReceive), xp);
        }