コード例 #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();
        }
コード例 #2
0
ファイル: Client.cs プロジェクト: zaferc18/server
        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;
            }
        }