示例#1
0
        private void StartReceiving(IWritableReactiveTable currenciesWire, Dictionary <string, int> columnsToFieldIds, int port)
        {
            var endPoint = new IPEndPoint(IPAddress.Loopback, port);
            var client   = new ReactiveTableTcpClient <IWritableReactiveTable>(new ProtobufTableDecoder(), currenciesWire,
                                                                               new ProtobufDecoderState(columnsToFieldIds.InverseUniqueDictionary()), endPoint);

            _clients.Add(client);
            client.Start();
        }
示例#2
0
        private void StartReceiving(IWritableReactiveTable wireTable, Dictionary <string, int> columnsToFieldIds, int port, IReactiveTableProcessor <IWritableReactiveTable> decoder)
        {
            var endPoint = new IPEndPoint(IPAddress.Loopback, port);
            var client   = new ReactiveTableTcpClient <IWritableReactiveTable>(decoder,
                                                                               wireTable,
                                                                               GetDecoderState(columnsToFieldIds),
                                                                               endPoint);

            _feedClient = client;
            try
            {
                client.Start();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
        }
示例#3
0
        private void SetupFeedSubscription(IReactiveTable currenciesTable, IReactiveTableProcessor <IReactiveTable> encoder)
        {
            var endPoint           = new IPEndPoint(IPAddress.Loopback, (int)ServerPorts.BrokerFeedClients);
            var selectedCurrencies = new FilteredTable(
                currenciesTable,
                new DelegatePredicate1 <bool>(BrokerTableDefinition.BrokerClientColumns.ClientSide.Selected, selected => selected));

            var client = new ReactiveTableTcpClient <IReactiveTable>(encoder,
                                                                     selectedCurrencies,
                                                                     GetEncoderState(),
                                                                     endPoint);

            _ccyPairSubscriptionClient = client;
            try
            {
                client.Start();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
        }