This class manages a set of inbound pipes. On receive it performs fair queueing so that senders gone berserk won't cause denial of service for decent senders.
Example #1
0
File: Pull.cs Project: cjkao/netmq
        public Pull([NotNull] Ctx parent, int threadId, int socketId)
            : base(parent, threadId, socketId)
        {
            m_options.SocketType = ZmqSocketType.Pull;

            m_fairQueueing = new FairQueueing();
        }
Example #2
0
        /// <summary>
        /// Create a new Dealer socket that holds the prefetched message.
        /// </summary>
        public Dealer([NotNull] Ctx parent, int threadId, int socketId)
            : base(parent, threadId, socketId)
        {
            m_prefetched = false;
            m_options.SocketType = ZmqSocketType.Dealer;

            m_fairQueueing = new FairQueueing();
            m_loadBalancer = new LoadBalancer();

            m_options.RecvIdentity = true;

            m_prefetchedMsg = new Msg();
            m_prefetchedMsg.InitEmpty();
        }
Example #3
0
 /// <summary>
 /// Create a new Router instance with the given parent-Ctx, thread-id, and socket-id.
 /// </summary>
 /// <param name="parent">the Ctx that will contain this Router</param>
 /// <param name="threadId">the integer thread-id value</param>
 /// <param name="socketId">the integer socket-id value</param>
 public Router( Ctx parent, int threadId, int socketId)
     : base(parent, threadId, socketId)
 {
     m_nextPeerId = s_random.Next();
     m_options.SocketType = ZmqSocketType.Router;
     m_fairQueueing = new FairQueueing();
     m_prefetchedId = new Msg();
     m_prefetchedId.InitEmpty();
     m_prefetchedMsg = new Msg();
     m_prefetchedMsg.InitEmpty();
     m_anonymousPipes = new HashSet<Pipe>();
     m_outpipes = new Dictionary<byte[], Outpipe>(new ByteArrayEqualityComparer());
     m_options.RecvIdentity = true;
 }
Example #4
0
        public Stream([NotNull] Ctx parent, int threadId, int socketId)
            : base(parent, threadId, socketId)
        {
            m_prefetched = false;
            m_identitySent = false;
            m_currentOut = null;
            m_moreOut = false;
            m_nextPeerId = s_random.Next();

            m_options.SocketType = ZmqSocketType.Stream;

            m_fairQueueing = new FairQueueing();
            m_prefetchedId = new Msg();
            m_prefetchedId.InitEmpty();
            m_prefetchedMsg = new Msg();
            m_prefetchedMsg.InitEmpty();

            m_outpipes = new Dictionary<byte[], Outpipe>(new ByteArrayEqualityComparer());

            m_options.RawSocket = true;
        }
Example #5
-1
        public XSub([NotNull] Ctx parent, int threadId, int socketId)
            : base(parent, threadId, socketId)
        {
            m_options.SocketType = ZmqSocketType.Xsub;
            m_hasMessage = false;
            m_more = false;

            m_options.Linger = 0;
            m_fairQueueing = new FairQueueing();
            m_distribution = new Distribution();
            m_subscriptions = new Trie();

            m_message = new Msg();
            m_message.InitEmpty();
        }