Exemple #1
0
        public Pull(Ctx parent, int threadId, int sid)
            : base(parent, threadId, sid)
        {
            m_options.SocketType = ZmqSocketType.Pull;

            m_fq = new FQ();
        }
Exemple #2
0
        public Router(Ctx parent, int threadId, int sid)
            : base(parent, threadId, sid)
        {
            m_prefetched   = false;
            m_identitySent = false;
            m_moreIn       = false;
            m_currentOut   = null;
            m_moreOut      = false;
            m_nextPeerId   = Utils.GenerateRandom();
            m_mandatory    = false;
            m_rawSocket    = false;

            m_options.SocketType = ZmqSocketType.Router;


            m_fq            = new FQ();
            m_prefetchedId  = new Msg();
            m_prefetchedMsg = new Msg();

            m_anonymousPipes = new HashSet <Pipe>();
            m_outpipes       = new Dictionary <Blob, Outpipe>();

            //  TODO: Uncomment the following line when ROUTER will become true ROUTER
            //  rather than generic router socket.
            //  If peer disconnect there's noone to send reply to anyway. We can drop
            //  all the outstanding requests from that peer.
            //  options.delay_on_disconnect = false;

            m_options.RecvIdentity = true;
        }
Exemple #3
0
        public Pull(Ctx parent, int threadId, int sid)
            : base(parent, threadId, sid)
        {
            m_options.SocketType = ZmqSocketType.Pull;

            m_fq = new FQ();
        }
Exemple #4
0
        public XSub(Ctx parent, int threadId, int sid) : base(parent, threadId, sid)
        {
            m_options.SocketType = ZmqSocketType.Xsub;
            m_hasMessage         = false;
            m_more = false;

            m_options.Linger = 0;
            m_fq             = new FQ();
            m_dist           = new Dist();
            m_subscriptions  = new Trie();
        }
Exemple #5
0
        //  Holds the prefetched message.
        public Dealer(Ctx parent, int tid, int sid)
            : base(parent, tid, sid)
        {
            m_prefetched = false;
            m_options.SocketType = ZmqSocketType.Dealer;

            m_fq = new FQ();
            m_lb = new LB();
            //  TODO: Uncomment the following line when DEALER will become true DEALER
            //  rather than generic dealer socket.
            //  If the socket is closing we can drop all the outbound requests. There'll
            //  be noone to receive the replies anyway.
            //  options.delay_on_close = false;

            m_options.RecvIdentity = true;
        }
Exemple #6
0
        //  Holds the prefetched message.
        public Dealer(Ctx parent, int threadId, int sid)
            : base(parent, threadId, sid)
        {
            m_prefetched         = false;
            m_options.SocketType = ZmqSocketType.Dealer;

            m_fq = new FQ();
            m_lb = new LB();
            //  TODO: Uncomment the following line when DEALER will become true DEALER
            //  rather than generic dealer socket.
            //  If the socket is closing we can drop all the outbound requests. There'll
            //  be noone to receive the replies anyway.
            //  options.delay_on_close = false;

            m_options.RecvIdentity = true;
        }
Exemple #7
0
        public Stream(Ctx parent, int threadId, int sid)
            : base(parent, threadId, sid)
        {
            m_prefetched = false;
              m_identitySent = false;
              m_currentOut = null;
              m_moreOut = false;
              m_nextPeerId = Utils.GenerateRandom();

              m_options.SocketType = ZmqSocketType.Stream;

              m_fq = new FQ();
              m_prefetchedId = new Msg();
              m_prefetchedMsg = new Msg();

              m_outpipes = new Dictionary<Blob, Outpipe>();

              m_options.RawSocket = true;
        }
Exemple #8
0
        public Stream(Ctx parent, int threadId, int sid)
            : base(parent, threadId, sid)
        {
            m_prefetched   = false;
            m_identitySent = false;
            m_currentOut   = null;
            m_moreOut      = false;
            m_nextPeerId   = Utils.GenerateRandom();

            m_options.SocketType = ZmqSocketType.Stream;


            m_fq            = new FQ();
            m_prefetchedId  = new Msg();
            m_prefetchedMsg = new Msg();

            m_outpipes = new Dictionary <Blob, Outpipe>();

            m_options.RawSocket = true;
        }
Exemple #9
0
        public XSub(Ctx parent, int tid, int sid)
            : base(parent, tid, sid)
        {
            m_options.SocketType = ZmqSocketType.Xsub;
            m_hasMessage = false;
            m_more = false;

            m_options.Linger = 0;
            m_fq = new FQ();
            m_dist = new Dist();
            m_subscriptions = new Trie();
        }
Exemple #10
0
        public Router(Ctx parent, int threadId, int sid)
            : base(parent, threadId, sid)
        {
            m_prefetched = false;
            m_identitySent = false;
            m_moreIn = false;
            m_currentOut = null;
            m_moreOut = false;
            m_nextPeerId = Utils.GenerateRandom();
            m_mandatory = false;
            m_rawSocket = false;

            m_options.SocketType = ZmqSocketType.Router;

            m_fq = new FQ();
            m_prefetchedId = new Msg();
            m_prefetchedMsg = new Msg();

            m_anonymousPipes = new HashSet<Pipe>();
            m_outpipes = new Dictionary<Blob, Outpipe>();

            //  TODO: Uncomment the following line when ROUTER will become true ROUTER
            //  rather than generic router socket.
            //  If peer disconnect there's noone to send reply to anyway. We can drop
            //  all the outstanding requests from that peer.
            //  options.delay_on_disconnect = false;

            m_options.RecvIdentity = true;
        }