Clear() public method

public Clear ( ) : void
return void
コード例 #1
0
        private void SendToClient()
        {
            try
            {
                while (_running)
                {
                    try
                    {
                        QuickFix.Message msg = null;
#if _CQUEUE
                        if (!_queueMsg.TryDequeue(out msg))
                        {
                            lock (_queueMsg)
                                Monitor.Wait(_queueMsg, 50);
                        }
#else
                        lock (_queueMsg)
                        {
                            if (_queueMsg.Count > 0)
                            {
                                msg = _queueMsg.Dequeue();
                            }
                            else
                            {
                                Monitor.Wait(_queueMsg, 5);
                                continue;
                            }
                        }
#endif
                        if (null != msg)
                        {
                            this._processMessage(msg);
                            msg.Clear();
                        }
                        msg = null;
                    }
                    catch (Exception ex)
                    {
                        logger.Error("erro no envio pro acceptor:" + ex.Message, ex);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error("SendToClient() - Erro no envio para client: " + ex.Message, ex);
            }
        }
コード例 #2
0
ファイル: SessionAcceptor.cs プロジェクト: radtek/Gradual
        private void _sendMessageBBGIntegration(string msgType, QuickFix.Message msgQF, TOMessage to, int account)
        {
            try
            {
                this.Send2DropCopy(msgQF); // Envio de mensagem 4.4 para a sessao drop copy
                // Validar se deve efetuar o cast da conta para mnemonico
                if (this.Config.ParseAccount)
                {
                    string mnemonic = this.ParentAcceptor.GetMnemonicFromAccount(account);
                    if (!string.IsNullOrEmpty(mnemonic))
                    {
                        msgQF.SetField(new Account(mnemonic), true);
                    }
                }
                QuickFix.Message msgQF42 = null;
                if (msgType == MsgType.EXECUTION_REPORT)
                {
                    msgQF42 = Fix42TranslatorBBG.Fix44ER_2_Fix42ER((QuickFix.FIX44.ExecutionReport)msgQF);
                }
                if (msgType == MsgType.ORDER_CANCEL_REJECT)
                {
                    msgQF42 = Fix42TranslatorBBG.Fix44OCR_2_Fix42OCR((QuickFix.FIX44.OrderCancelReject)msgQF);
                }

                Session.SendToTarget(msgQF42, to.Sessao);

                msgQF.Clear();
                msgQF = null;
                if (null != msgQF42)
                {
                    msgQF42.Clear();
                }
                msgQF42 = null;
            }
            catch (Exception ex)
            {
                logger.Error("Problemas no envio de mensagem de integração BBG: " + ex.Message, ex);
            }
        }
コード例 #3
0
ファイル: SessionAcceptor.cs プロジェクト: radtek/Gradual
        private void _sendDefaultMessageIntegration(QuickFix.Message msgQF, TOMessage to, int account)
        {
            try
            {
                this.Send2DropCopy(msgQF);
                // Validar se deve efetuar o cast da conta para mnemonico
                if (this.Config.ParseAccount)
                {
                    string mnemonic = this.ParentAcceptor.GetMnemonicFromAccount(account);
                    if (!string.IsNullOrEmpty(mnemonic))
                    {
                        msgQF.SetField(new Account(mnemonic), true);
                    }
                }
                Session.SendToTarget(msgQF, to.Sessao);

                msgQF.Clear();
                msgQF = null;
            }
            catch (Exception ex)
            {
                logger.Error("Problemas no envio da mensagem de integracao default: " + ex.Message, ex);
            }
        }