コード例 #1
0
        public static IIntermediarySocket AsIntermediary(this EasyZMqConfigurer configurer, string backendAddress)
        {
            var frontendAddressBinder = configurer.AddressBinder;
            var backendAddressBinder  = new BindAddressBinder(new Uri(backendAddress));

            return(CreateIntermediarySocket(frontendAddressBinder, backendAddressBinder));
        }
コード例 #2
0
        public static IPublisherSocket AsPublisher(this EasyZMqConfigurer configurer)
        {
            var serializer    = configurer.Serializer;
            var addressBinder = configurer.AddressBinder;
            var socket        = new NetMQ.Sockets.PublisherSocket();

            return(new PublisherSocket(serializer, addressBinder, socket));
        }
コード例 #3
0
        public static IDynamicPublisherSocket AsDynamicPublisher(this EasyZMqConfigurer configurer)
        {
            var serializer    = new TypeUnawareJsonSerializer();
            var addressBinder = configurer.AddressBinder;
            var socket        = new NetMQ.Sockets.PublisherSocket();

            return(new PublisherSocket(serializer, addressBinder, socket));
        }
コード例 #4
0
        public static ISubscriberSocket AsSubscriber(this EasyZMqConfigurer configurer, string topic)
        {
            var serializer        = configurer.Serializer;
            var addressBinder     = configurer.AddressBinder;
            var loggerFactory     = configurer.LoggerFactory;
            var messageDispatcher = configurer.MessageDispatcher;

            var socket = new NetMQ.Sockets.SubscriberSocket();

            socket.Subscribe(topic);

            return(new SubscriberSocket(serializer, addressBinder, loggerFactory, messageDispatcher, socket));
        }
コード例 #5
0
        public static EasyZMqConfigurer UseLog4Net(this EasyZMqConfigurer configurer)
        {
            configurer.Use(new Log4NetLoggerFactory());

            return(configurer);
        }