コード例 #1
0
ファイル: RealTimeDataServer.cs プロジェクト: herbota/QDMS
        // Accept a request to cancel a real time data stream
        // Obviously we only actually cancel it if
        private void HandleRealTtimeDataCancelRequest()
        {
            bool hasMore;
            var  buffer = _requestSocket.ReceiveFrameBytes(out hasMore);

            // Receive the instrument
            using (var ms = new MemoryStream())
            {
                var instrument = MyUtils.ProtoBufDeserialize <Instrument>(buffer, ms);

                var     freqBuff  = _requestSocket.ReceiveFrameBytes(out hasMore);
                BarSize frequency = MyUtils.ProtoBufDeserialize <BarSize>(freqBuff, ms);

                if (instrument.ID != null)
                {
                    _broker.CancelRTDStream(instrument.ID.Value, frequency);
                }
                // Two part message:
                // 1: MessageType.RTDCanceled
                // 2: the instrument symbol
                // 3: the frequency
                _requestSocket.SendMoreFrame(MessageType.RTDCanceled);
                _requestSocket.SendMoreFrame(instrument.Symbol);
                _requestSocket.SendFrame(freqBuff);
            }
        }
コード例 #2
0
ファイル: RealTimeDataServer.cs プロジェクト: KBurov/qdms
        // Accept a request to cancel a real time data stream
        // Obviously we only actually cancel it if
        private void HandleRealTtimeDataCancelRequest()
        {
            bool hasMore;
            var  buffer = _requestSocket.ReceiveFrameBytes(out hasMore);

            // Receive the instrument
            using (var ms = new MemoryStream()) {
                var instrument = MyUtils.ProtoBufDeserialize <Instrument>(buffer, ms);

                if (instrument.ID != null)
                {
                    _broker.CancelRTDStream(instrument.ID.Value);
                }
                // Two part message:
                // 1: "CANCELED"
                // 2: the symbol
                _requestSocket.SendMoreFrame("CANCELED");
                _requestSocket.SendFrame(instrument.Symbol);
            }
        }
コード例 #3
0
        // Accept a request to cancel a real time data stream
        // Obviously we only actually cancel it if
        private void HandleRealTtimeDataCancelRequest()
        {
            bool hasMore;
            var  buffer = _requestSocket.ReceiveFrameBytes(out hasMore);

            // Receive the instrument
            using (var ms = new MemoryStream())
            {
                //todo change to id and freq
                var instrument = MyUtils.ProtoBufDeserialize <Instrument>(buffer, ms);

                if (instrument.ID != null)
                {
                    _broker.CancelRTDStream(instrument.ID.Value);
                }
                // Two part message:
                // 1: MessageType.RTDCanceled
                // 2: the instrument symbol
                //todo do we need to reply here?
                _requestSocket.SendMoreFrame(MessageType.RTDCanceled);
                _requestSocket.SendFrame(instrument.Symbol);
            }
        }