private void RebuildPollset()
{
#if !NET35
Debug.Assert(m_isSchedulerThread.Value);
#endif
// Recreate the m_pollSet and m_pollact arrays.
m_pollSet = new SelectItem[m_sockets.Count + m_pollinSockets.Count];
m_pollact = new NetMQSocket[m_sockets.Count];
// For each socket in m_sockets,
// put a corresponding SelectItem into the m_pollSet array and a reference to the socket itself into the m_pollact array.
uint index = 0;
foreach (var socket in m_sockets)
{
m_pollSet[index] = new SelectItem(socket.SocketHandle, socket.GetPollEvents());
m_pollact[index] = socket;
index++;
}
foreach (var socket in m_pollinSockets.Keys)
{
m_pollSet[index] = new SelectItem(socket, PollEvents.PollError | PollEvents.PollIn);
index++;
}
// Mark this as NOT having any fresh events to attend to, as yet.
m_isPollSetDirty = false;
}