Ejemplo n.º 1
0
        public int Update()
        {
            int free;

            while (m_PendingFree.TryDequeue(out free))
            {
                int ver = m_ConnectionList[free].Version + 1;
                if (ver == 0)
                {
                    ver = 1;
                }
                m_ConnectionList[free] = new Connection {
                    Id = free, Version = ver
                };
                m_FreeList.ReleaseConnectionId(free);
            }

            if (m_EventQueue.Count != 0)
            {
                Debug.LogError("Resetting event queue with pending events (Count=" + m_EventQueue.Count + ")");
            }
            m_EventQueue.Reset();
            m_BitStream.Reset();
            CheckTimeouts();
            return(ProcessPackets(m_BitStream));
        }
Ejemplo n.º 2
0
 public unsafe void ReleaseEndPoint(NetworkEndPoint endpoint)
 {
     if (endpoint.family == NetworkFamily.IPC)
     {
         int *handle = (int *)endpoint.address;
         m_IPCQueue.Reset(*handle);
         // Bunp the version of the endpoint
         ++m_IPCEndPoints[*handle];
         if (m_IPCEndPoints[*handle] == 0)
         {
             ++m_IPCEndPoints[*handle];
         }
         m_FreeList.ReleaseConnectionId(*handle);
     }
 }