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(); }
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; }
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(); }
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(); }
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(); }