示例#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));
                }
            };
        }