NetMQ.Core.Ctx.DestroySocket C# (CSharp) Method

DestroySocket() public method

Destroy the given socket - which means to remove it from the list of active sockets, and add it to the list of unused sockets to be terminated.
If this was the last socket, then stop the reaper.
public DestroySocket ( [ socket ) : void
socket [ the socket to destroy
return void
        public void DestroySocket([NotNull] SocketBase socket)
        {
            // Free the associated thread slot.
            lock (m_slotSync)
            {
                int threadId = socket.ThreadId;
                m_emptySlots.Push(threadId);
                m_slots[threadId].Close();
                m_slots[threadId] = null;

                // Remove the socket from the list of sockets.
                m_sockets.Remove(socket);

                // If zmq_term() was already called and there are no more socket
                // we can ask reaper thread to terminate.
                if (m_terminating && m_sockets.Count == 0)
                    m_reaper.Stop();
            }

            //LOG.debug("Released Slot [" + socket_ + "] ");
        }

Usage Example

Example #1
0
 protected void DestroySocket([NotNull] SocketBase socket)
 {
     m_ctx.DestroySocket(socket);
 }
All Usage Examples Of NetMQ.Core.Ctx::DestroySocket