Esempio n. 1
0
        public static bool GetLoopPacket(int sock, netadr_t net_from, sizebuf_t net_message)
        {
            loopback_t loop = loopbacks[sock];

            if (loop.send - loop.get > MAX_LOOPBACK)
            {
                loop.get = loop.send - MAX_LOOPBACK;
            }
            if (loop.get >= loop.send)
            {
                return(false);
            }
            int i = loop.get & (MAX_LOOPBACK - 1);

            loop.get++;
            System.Array.Copy(loop.msgs[i].data, 0, net_message.data, 0, loop.msgs[i].datalen);
            net_message.cursize = loop.msgs[i].datalen;
            net_from.Set(net_local_adr);
            return(true);
        }
Esempio n. 2
0
 static NET()
 {
     loopbacks[0] = new loopback_t();
     loopbacks[1] = new loopback_t();
 }