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

            m_fairQueueing = new FairQueueing();
        }
Exemplo n.º 2
0
        public Gather(Ctx parent, int threadId, int socketId)
            : base(parent, threadId, socketId)
        {
            m_options.SocketType = ZmqSocketType.Gather;

            m_fairQueueing = new FairQueueing();
        }
Exemplo n.º 3
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_options.SocketType = ZmqSocketType.Dealer;

            m_fairQueueing = new FairQueueing();
            m_loadBalancer = new LoadBalancer();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Create a new Dealer socket that holds the prefetched message.
        /// </summary>
        public Client([NotNull] Ctx parent, int threadId, int socketId)
            : base(parent, threadId, socketId, true)
        {
            m_options.SocketType      = ZmqSocketType.Client;
            m_options.CanSendHelloMsg = true;

            m_fairQueueing = new FairQueueing();
            m_loadBalancer = new LoadBalancer();
        }
Exemplo n.º 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 Server(Ctx parent, int threadId, int socketId)
     : base(parent, threadId, socketId, true)
 {
     m_nextRoutingId           = (uint)s_random.Next();
     m_options.SocketType      = ZmqSocketType.Server;
     m_options.CanSendHelloMsg = true;
     m_fairQueueing            = new FairQueueing();
     m_outpipes = new Dictionary <uint, Outpipe>();
 }
Exemplo n.º 6
0
        /// <summary>
        /// Create a new Dealer socket that holds the prefetched message.
        /// </summary>
        public Dealer(Ctx parent, int threadId, int socketId)
            : base(parent, threadId, socketId)
        {
            m_options.SocketType      = ZmqSocketType.Dealer;
            m_options.CanSendHelloMsg = true;

            m_fairQueueing = new FairQueueing();
            m_loadBalancer = new LoadBalancer();
        }
Exemplo n.º 7
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 Peer([NotNull] Ctx parent, int threadId, int socketId)
     : base(parent, threadId, socketId)
 {
     m_nextPeerId         = s_random.Next();
     m_options.SocketType = ZmqSocketType.Peer;
     m_fairQueueing       = new FairQueueing();
     m_prefetchedMsg      = new Msg();
     m_prefetchedMsg.InitEmpty();
     m_outpipes       = new Dictionary <byte[], Outpipe>(new ByteArrayEqualityComparer());
     m_sendingState   = State.RoutingId;
     m_receivingState = State.RoutingId;
 }
Exemplo n.º 8
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_prefetchedMsg = new Msg();
            m_prefetchedMsg.InitEmpty();
        }
Exemplo n.º 9
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 Peer(Ctx parent, int threadId, int socketId)
     : base(parent, threadId, socketId)
 {
     m_nextPeerId              = (uint)s_random.Next();
     m_options.SocketType      = ZmqSocketType.Peer;
     m_options.CanSendHelloMsg = true;
     m_fairQueueing            = new FairQueueing();
     m_prefetchedMsg           = new Msg();
     m_prefetchedMsg.InitEmpty();
     m_outpipes       = new Dictionary <uint, Outpipe>();
     m_sendingState   = State.RoutingId;
     m_receivingState = State.RoutingId;
 }
Exemplo n.º 10
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;
 }
Exemplo n.º 11
0
        public XSub(Ctx parent, int threadId, int socketId)
            : base(parent, threadId, socketId)
        {
            m_options.SocketType = ZmqSocketType.Xsub;
            m_hasMessage         = false;
            m_moreIn             = false;

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

            m_message = new Msg();
            m_message.InitEmpty();
        }
Exemplo n.º 12
0
        public Stream([NotNull] Ctx parent, int threadId, int socketId)
            : base(parent, threadId, socketId)
        {
            this.m_prefetched   = false;
            this.m_identitySent = false;
            this.m_currentOut   = null;
            this.m_moreOut      = false;
            this.m_nextPeerId   = Stream.s_random.Next();

            this.m_options.SocketType = ZmqSocketType.Stream;

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

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

            this.m_options.RawSocket = true;
        }
Exemplo n.º 13
0
        public Router(Ctx parent, int threadId, int socketId) : base(parent, threadId, socketId)
        {
            m_prefetched   = false;
            m_identitySent = false;
            m_moreIn       = false;
            m_currentOut   = null;
            m_moreOut      = false;
            m_nextPeerId   = new Random().Next();
            m_mandatory    = false;
            m_rawSocket    = false;

            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;
        }