예제 #1
0
파일: XPub.cs 프로젝트: newstrading/netmq
        static XPub()
        {
            s_markAsMatching = (pipe, data, size, arg) =>
            {
                var self = (XPub)arg;
                // skip the sender of a broadcast message
                if (!(self.m_broadcastEnabled && self.m_lastPipeIsBroadcast && self.m_lastPipe == pipe))
                {
                    self.m_distribution.Match(pipe);
                }
            };

            s_sendUnsubscription = (pipe, data, size, arg) =>
            {
                var self = (XPub)arg;

                if (self.m_options.SocketType != ZmqSocketType.Pub)
                {
                    // Place the unsubscription to the queue of pending (un)subscriptions
                    // to be retrieved by the user later on.

                    var unsubMsg = new Msg();
                    unsubMsg.InitPool(size + 1);
                    unsubMsg[0] = 0;
                    unsubMsg.Put(data, 1, size);

                    self.m_pendingMessages.Enqueue(new KeyValuePair <Msg, Pipe>(unsubMsg, pipe));
                }
            };
        }
예제 #2
0
파일: XPub.cs 프로젝트: fhchina/netmq
        static XPub()
        {
            s_markAsMatching = (pipe, data, size, arg) =>
            {
                XPub self = (XPub)arg;
                self.m_distribution.Match(pipe);
            };

            s_SendUnsubscription = (pipe, data, size, arg) =>
            {
                XPub self = (XPub)arg;

                if (self.m_options.SocketType != ZmqSocketType.Pub)
                {
                    //  Place the unsubscription to the queue of pending (un)sunscriptions
                    //  to be retrived by the user later on.

                    byte[] unsub = new byte[size + 1];
                    unsub[0] = 0;
                    Buffer.BlockCopy(data, 0, unsub, 1, size);

                    self.m_pending.Enqueue(unsub);
                }
            };
        }
예제 #3
0
        static XPub()
        {
            s_markAsMatching = (pipe, data, size, arg) =>
            {
                var self = (XPub)arg;
                self.m_distribution.Match(pipe);
            };

            s_sendUnsubscription = (pipe, data, size, arg) =>
            {
                var self = (XPub)arg;

                if (self.m_options.SocketType != ZmqSocketType.Pub)
                {
                    //  Place the unsubscription to the queue of pending (un)subscriptions
                    //  to be retrieved by the user later on.

                    var unsub = new byte[size + 1];
                    unsub[0] = 0;
                    Buffer.BlockCopy(data, 0, unsub, 1, size);

                    self.m_pending.Enqueue(unsub);
                }
            };
        }
예제 #4
0
파일: XPub.cs 프로젝트: b-cuts/netmq
        static XPub()
        {
            s_markAsMatching = (pipe, data, size, arg) =>
            {
                var self = (XPub)arg;
                // skip the sender of a broadcast message
                if (!(self.m_broadcastEnabled && self.m_lastPipeIsBroadcast && self.m_lastPipe == pipe))
                {
                    self.m_distribution.Match(pipe);
                }
            };

            s_sendUnsubscription = (pipe, data, size, arg) =>
            {
                var self = (XPub)arg;

                if (self.m_options.SocketType != ZmqSocketType.Pub)
                {
                    // Place the unsubscription to the queue of pending (un)subscriptions
                    // to be retrieved by the user later on.

                    var unsubMsg = new Msg();
                    unsubMsg.InitPool(size + 1);
                    unsubMsg[0] = 0;
                    unsubMsg.Put(data, 1, size);

                    self.m_pendingMessages.Enqueue(new KeyValuePair<Msg, Pipe>(unsubMsg, pipe));
                }
            };
        }