NetMQ.Core.SocketBase.StartReaping C# (CSharp) Method

StartReaping() private method

Using this function reaper thread ask the socket to register with its poller.
private StartReaping ( [ poller ) : void
poller [
return void
        internal void StartReaping([NotNull] Utils.Poller poller)
        {
            // Plug the socket to the reaper thread.
            m_poller = poller;
            m_handle = m_mailbox.Handle;
            m_poller.AddHandle(m_handle, this);
            m_poller.SetPollIn(m_handle);

            // Initialise the termination and check whether it can be deallocated
            // immediately.
            Terminate();
            CheckDestroy();
        }

Usage Example

Example #1
0
        /// <summary>
        /// Add the given socket to the list to be reaped (terminated).
        /// </summary>
        /// <param name="socket">the socket to add to the list for termination</param>
        protected override void ProcessReap(SocketBase socket)
        {
            // Add the socket to the poller.
            socket.StartReaping(m_poller);

            ++m_sockets;
        }