示例#1
0
 protected AbstractSenderSocket(ISerializer serializer, IAddressBinder addressBinder, NetMQSocket socket)
 {
     _serializer    = serializer;
     _addressBinder = addressBinder;
     _socket        = socket;
     _addressBinder.ConnectOrBindAddress(socket);
 }
示例#2
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);
        }
示例#3
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);
        }
示例#4
0
        public void Start()
        {
            if (_disposedValue)
            {
                throw new ObjectDisposedException("EasyZMqReceiverSocket");
            }
            if (_isStarted)
            {
                throw new InvalidOperationException("Subscriber already running!");
            }

            _addressBinder.ConnectOrBindAddress(_socket);

            _poller.RunAsync();

            _isStarted = true;
        }