Beispiel #1
0
        public Pull([NotNull] Ctx parent, int threadId, int socketId)
            : base(parent, threadId, socketId)
        {
            m_options.SocketType = ZmqSocketType.Pull;

            m_fairQueueing = new FairQueueing();
        }
Beispiel #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();
        }
Beispiel #3
0
        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();
        }
Beispiel #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;
        }
Beispiel #5
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([NotNull] 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;
 }