コード例 #1
0
 public RequestResponseServer(MqServer server)
 {
     if (!ServerUtils.IsPortOpen(server.HostIp, server.Port, TimeSpan.FromSeconds(2)))
     {
         throw new PortIsInUseException($"{server.GetAddress()} is in use.");
     }
     responseSocketConnectionString = server.GetAddress();
 }
コード例 #2
0
 public HistoricalDataServer(MqServer server, IHistoricalDataBroker broker)
 {
     if (!ServerUtils.IsPortOpen(server.HostIp, server.Port, TimeSpan.FromSeconds(2)))
     {
         throw new PortIsInUseException($"{server.GetAddress()} is in use.");
     }
     connectionString = server.GetAddress();
     this.broker      = broker ?? throw new ArgumentNullException(nameof(broker), $"{nameof(broker)} cannot be null");
     this.broker.HistoricalDataArrived += BrokerHistoricalDataArrived;
 }
コード例 #3
0
        public EquityUpdateServer(MqServer server)
        {
            if (!ServerUtils.IsPortOpen(server.HostIp, server.Port, TimeSpan.FromSeconds(2)))
            {
                throw new PortIsInUseException($"{server.GetAddress()} is in use.");
            }



            routerConnectionString = server.GetAddress();
            routerSocket           = new RouterSocket();
        }
コード例 #4
0
        public MessagesServer(MqServer server)
        {
            //if (publisher.GetAddress() == pull.GetAddress())
            //{
            //    throw new ArgumentException("Publish and request ports must be different");
            //}

            //publisherConnectionString = publisher.GetAddress();
            if (!ServerUtils.IsPortOpen(server.HostIp, server.Port, TimeSpan.FromSeconds(2)))
            {
                throw new PortIsInUseException($"{server.GetAddress()} is in use.");
            }
            pullSocketConnectionString = server.GetAddress();
        }
コード例 #5
0
        public RealTimeDataServer(MqServer server, IRealTimeDataBroker broker)
        {
            if (!ServerUtils.IsPortOpen(server.HostIp, server.Port, TimeSpan.FromSeconds(2)))
            {
                throw new PortIsInUseException($"{server.GetAddress()} is in use.");
            }
            this.broker = broker ?? throw new ArgumentNullException(nameof(broker));
            this.broker.RealTimeDataArrived += BrokerRealTimeDataArrived;
            //if (publish.GetAddress() == request.GetAddress())
            //{
            //    throw new ArgumentException("Publish and request ports must be different");
            //}

            //publisherConnectionString = publish.GetAddress();

            requestConnectionString = server.GetAddress();
        }