コード例 #1
0
 protected AbstractSenderSocket(ISerializer serializer, IAddressBinder addressBinder, NetMQSocket socket)
 {
     _serializer    = serializer;
     _addressBinder = addressBinder;
     _socket        = socket;
     _addressBinder.ConnectOrBindAddress(socket);
 }
コード例 #2
0
        private static EasyZMqConfigurer CreateConfigurer(IAddressBinder addressBinder)
        {
            var configurer = new EasyZMqConfigurer();

            RegisterAddressBinder(configurer, addressBinder);

            return(configurer);
        }
コード例 #3
0
ファイル: EasyZMqConfigure.cs プロジェクト: simonbaas/EasyZMq
        private static EasyZMqConfigurer CreateConfigurer(IAddressBinder addressBinder)
        {
            var configurer = new EasyZMqConfigurer();

            RegisterAddressBinder(configurer, addressBinder);

            return configurer;
        }
コード例 #4
0
        private static IIntermediarySocket CreateIntermediarySocket(IAddressBinder frontendAddressBinder,
                                                                    IAddressBinder backendAddressBinder)
        {
            var frontendSocket = new NetMQ.Sockets.XSubscriberSocket();
            var backendSocket  = new NetMQ.Sockets.XPublisherSocket();

            return(new IntermediarySocket(frontendAddressBinder, backendAddressBinder, frontendSocket, backendSocket));
        }
コード例 #5
0
        private static IIntermediarySocket CreateIntermediarySocket(IAddressBinder frontendAddressBinder,
            IAddressBinder backendAddressBinder)
        {
            var context = NetMQContext.Create();
            var frontendSocket = context.CreateXSubscriberSocket();
            var backendSocket = context.CreateXPublisherSocket();

            return new IntermediarySocket(frontendAddressBinder, backendAddressBinder, frontendSocket, backendSocket);
        }
コード例 #6
0
        internal void Use(IAddressBinder addressBinder)
        {
            if (addressBinder == null)
            {
                throw new ArgumentNullException(nameof(addressBinder));
            }

            _ioC.Register(() => addressBinder);
        }
コード例 #7
0
        protected AbstractReceiverSocket(ISerializer serializer, IAddressBinder addressBinder, ILoggerFactory loggerFactory, NetMQSocket socket)
        {
            _logger        = loggerFactory.GetLogger(typeof(AbstractReceiverSocket));
            _serializer    = serializer;
            _addressBinder = addressBinder;
            _socket        = socket;

            CreatePoller(socket);
            CreateConnectionMonitor(socket, _poller);
            ConfigureSocket(socket);
        }
コード例 #8
0
        public IntermediarySocket(IAddressBinder frontendAddressBinder, IAddressBinder backendAddressBinder,
            XSubscriberSocket frontendSocket, XPublisherSocket backendSocket)
        {
            _frontendAddressBinder = frontendAddressBinder;
            _backendAddressBinder = backendAddressBinder;
            _frontendSocket = frontendSocket;
            _backendSocket = backendSocket;

            _frontendAddressBinder.ConnectOrBindAddress(_frontendSocket);
            _backendAddressBinder.ConnectOrBindAddress(_backendSocket);

            _poller = new Poller(_frontendSocket, _backendSocket);
            _proxy = new Proxy(frontendSocket, backendSocket, poller: _poller);
        }
コード例 #9
0
        public IntermediarySocket(IAddressBinder frontendAddressBinder, IAddressBinder backendAddressBinder,
                                  XSubscriberSocket frontendSocket, XPublisherSocket backendSocket)
        {
            _frontendAddressBinder = frontendAddressBinder;
            _backendAddressBinder  = backendAddressBinder;
            _frontendSocket        = frontendSocket;
            _backendSocket         = backendSocket;

            _frontendAddressBinder.ConnectOrBindAddress(_frontendSocket);
            _backendAddressBinder.ConnectOrBindAddress(_backendSocket);

            _poller = new NetMQPoller {
                _frontendSocket, _backendSocket
            };
            _proxy = new Proxy(frontendSocket, backendSocket, poller: _poller);
        }
コード例 #10
0
 public SubscriberSocket(ISerializer serializer, IAddressBinder addressBinder, ILoggerFactory loggerFactory, IMessageDispatcher messageDispatcher,
                         NetMQSocket socket)
     : base(serializer, addressBinder, loggerFactory, socket)
 {
     _messageDispatcher = messageDispatcher;
 }
コード例 #11
0
 private static void RegisterAddressBinder(EasyZMqConfigurer configurer, IAddressBinder addressBinder)
 {
     configurer.Use(addressBinder);
 }
コード例 #12
0
ファイル: EasyZMqConfigure.cs プロジェクト: simonbaas/EasyZMq
 private static void RegisterAddressBinder(EasyZMqConfigurer configurer, IAddressBinder addressBinder)
 {
     configurer.Use(addressBinder);
 }
コード例 #13
0
        internal void Use(IAddressBinder addressBinder)
        {
            if (addressBinder == null) throw new ArgumentNullException(nameof(addressBinder));

            _ioC.Register(() => addressBinder);
        }
コード例 #14
0
ファイル: PublisherSocket.cs プロジェクト: simonbaas/EasyZMq
 public PublisherSocket(ISerializer serializer, IAddressBinder addressBinder, NetMQSocket socket)
     : base(serializer, addressBinder, socket)
 {
 }