Exemplo n.º 1
0
        private void CallReceive(IAsyncResult ar)
        {
            int receivedBytes = socket.EndReceive(ar);

            if (KeepCatching == true)
            {
                MainForm.NumOfReceivePackets++;//signal
                //Update.BeginInvoke(null, null);
                handle = new HandlePacket();
                handle.Unpack(receiveBufferBytes, receivedBytes, this, bStatus_Signal, bStatus_Signaling);
                handle = null;
                Array.Clear(receiveBufferBytes, 0, receiveBufferBytes.Length);
            }
            Array.Clear(receiveBufferBytes, 0, receiveBufferBytes.Length);
            BeginReceive();
        }
Exemplo n.º 2
0
 private void CallReceive(IAsyncResult ar)
 {
     try
     {
         int receivedBytes = socket.EndReceive(ar);
         if (KeepCatching == true)
         {
             handle = new HandlePacket();
             handle.Unpack(receiveBufferBytes, receivedBytes, this, bStatus_Signal, bStatus_Signaling);
             handle = null;
             Array.Clear(receiveBufferBytes, 0, receiveBufferBytes.Length);
         }
         Array.Clear(receiveBufferBytes, 0, receiveBufferBytes.Length);
     }
     catch (Exception e)
     {
     }
     BeginReceive();
 }