Esempio n. 1
0
        private void Ci_SendPacketEvent(int caveAddress, PacketType packetType, byte[] data)
        {
            switch (data[1])
            {
            case 1:
                Assert.IsTrue(myRecvFilter.MatchFilter(data));
                break;

            case 0:
                Assert.IsFalse(myRecvFilter.MatchFilter(data));
                break;
            }

            if (++count == 2)
            {
                lock (m_FinishedLock)
                    Monitor.Pulse(m_FinishedLock);
            }
        }
Esempio n. 2
0
        public static int ReceiveHook(IntPtr buf, int len)
        {
            byte[] buffer = new byte[len];
            Marshal.Copy(buf, buffer, 0, len);
#if FILTER_TEST
            if (buf.ToInt32() != myClientSendBuffer.ToInt32())
            {
                myClientInstance.SendCommand(Command.IncomingPacket, buffer);
                if (myRecvFilter.MatchFilter(buffer))
                {
                    return(1);
                }
            }
#else
            myClientInstance.SendCommand(Command.IncomingPacket, buffer);
#endif
            return(0);
        }