Exemple #1
0
        public static void Oyuncu_baglandi(string connectionID)

        {
            bagli_kullanici_sayisi++;
            Yazi.Log_Yaz("Kullanıcı Servera Bağlandı : " + connectionID);
            Sabitler.server.listBox1.Items.Add(connectionID);
            ServerHandleData.InitializePackets();
        }
Exemple #2
0
        private void OnReceiveData(IAsyncResult result)
        {
            try
            {
                int length = stream.EndRead(result);
                if (length <= 0)

                {
                    CloseConnection();
                    return;
                }
                byte[] newBytes = new byte[length];
                Array.Copy(recBuffer, newBytes, length);
                ServerHandleData.HandleData(connectionID, newBytes);
                stream.BeginRead(recBuffer, 0, socket.ReceiveBufferSize, OnReceiveData, null);
            }
            catch (Exception)
            {
                CloseConnection();


                return;
            }
        }