Exemplo n.º 1
0
        public void RegisterChannel(PushChannelConfig channel)
        {
            PushReceiverBase receiver = PushHelper.CreatePushReceiver(channel, _log);

            if (receiver == null)
            {
                return;
            }

            receiver.OnMessageReceived += new PushMessageReceivedHandler(receiver_OnMessageReceived);
            _channels.Add(receiver);
        }
Exemplo n.º 2
0
        public static void GenerateLPCChannel(PushChannelConfig cfg)
        {
            if (cfg == null)
            {
                return;
            }

            cfg.LPCConfig = new LPCChannelConfig();
            cfg.LPCConfig.SenderEntityID   = cfg.SenderEntityID;
            cfg.LPCConfig.ReceiverEntityID = cfg.ReceiverEntityID;

            cfg.MSMQConfig = null;
        }
Exemplo n.º 3
0
        public static PushReceiverBase CreatePushReceiver(PushChannelConfig config, ILog log)
        {
            if (config == null)
            {
                return(null);
            }

            switch (config.ProtocolType)
            {
            case ProtocolType.MSMQ:
                return(new MSMQReceiver(config, log));

            case ProtocolType.LPC:
                return(new LPCNotificationReceiver(config, log));
            }

            return(null);
        }
Exemplo n.º 4
0
        public static void GenerateMSMQChannel(PushChannelConfig cfg)
        {
            if (cfg == null)
            {
                return;
            }

            cfg.MSMQConfig = new MSMQChannelConfig();
            cfg.MSMQConfig.SenderParameter.MSMQ.Path       =
                cfg.MSMQConfig.ReceiverParameter.MSMQ.Path = @".\private$\" + cfg.SenderEntityName + "_" + cfg.ReceiverEntityName;

            // In workgroup mode, we only can create a private queue, and set permissions for Everyone so that NT service can access it.
            // Public queue can only be created in domain mode.

            //cfg.MSMQConfig.ReceiverParameter.MSMQ.Path = @".\" + cfg.SenderEntityName + "_" + cfg.ReceiverEntityName;

            // WinForm Host is running on login user permission, NT Service Host is running on SYSTEM user permissin.
            // Private queue can only be accessed by login user as default, we have to configure queue security setting manually before NT Service Host can access it.
            // Public queue can accessed by SYSTEM user as default, therefore we use public queue to build the push channel as default.  20080820

            cfg.LPCConfig = null;
        }
Exemplo n.º 5
0
 public PushSenderBase(PushChannelConfig config, ILog log)
 {
     _log    = log;
     Channel = config;
 }
Exemplo n.º 6
0
 public PushReceiverBase(PushChannelConfig config, ILog log)
 {
     _log    = log;
     Channel = config;
 }
Exemplo n.º 7
0
        public void RegisterChannel(PushChannelConfig channel)
        {
            PushSenderBase sender = PushHelper.CreatePushSender(channel, _log);

            _channels.Add(sender);
        }