Ejemplo n.º 1
0
        // commands
        private void SendNews(object ignored)
        {
            try
            {
                Trace.WriteLine(String.Format("Send news: Head=[{0}] Line1=[{1}]", this.Headline, this.Line1Text));
                string         h     = this.Headline;
                IList <string> lines = new List <string>();
                if (this.IsLine1Enabled)
                {
                    lines.Add(this.Line1Text);
                }
                if (this.IsLine2Enabled)
                {
                    lines.Add(this.Line2Text);
                }
                if (this.IsLine3Enabled)
                {
                    lines.Add(this.Line3Text);
                }

                QuickFix.FIX44.News news = MessageCreator44.News(h, lines);

                _qfapp.Send(news);
            }
            catch (Exception e)
            {
                Trace.WriteLine("Failed to send news message.\n" + e.ToString());
            }
        }
Ejemplo n.º 2
0
 public void OnMessage(QuickFix.FIX44.News msg, QuickFix.SessionID s)
 {
     if (msg.Headline.Obj == "TESTECHO")
     {
         Send(_messageGenerator.CreateNews("ECHORESPONSE"));
     }
 }
Ejemplo n.º 3
0
 public void OnMessage(QuickFix.FIX44.News msg, SessionID sessionId)
 {
     //byte[] ole = Encoding.UTF8.GetBytes("olé");
     QuickFix.FIX44.News response = new QuickFix.FIX44.News();
     response.Header.SetField(new QuickFix.Fields.MessageEncoding("UTF-8"));
     response.Headline = new QuickFix.Fields.Headline("ole");
     response.EncodedHeadline = new QuickFix.Fields.EncodedHeadline("olé");
     response.LinesOfText = new QuickFix.Fields.LinesOfText(0);
     Session.SendToTarget(response, sessionId);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Create a News message.  Nothing unexpected here.
        /// </summary>
        /// <param name="headline_str"></param>
        /// <param name="lines"></param>
        /// <returns></returns>
        static public QuickFix.FIX44.News News(string headline_str, IList <string> lines)
        {
            QuickFix.Fields.Headline headline = new QuickFix.Fields.Headline(headline_str);

            QuickFix.FIX44.News news = new QuickFix.FIX44.News(headline);
            QuickFix.FIX44.News.LinesOfTextGroup group = new QuickFix.FIX44.News.LinesOfTextGroup();
            foreach (string s in lines)
            {
                group.Text = new QuickFix.Fields.Text(s);
                news.AddGroup(group);
            }

            if (lines.Count == 0)
            {
                QuickFix.Fields.LinesOfText noLines = new QuickFix.Fields.LinesOfText(0);
                news.SetField(noLines, true);
            }

            return(news);
        }
Ejemplo n.º 5
0
 public void OnMessage(QuickFix.FIX44.News n, SessionID s)
 {
 }
Ejemplo n.º 6
0
 public void OnMessage(QuickFix.FIX44.News msg, SessionID s)
 {
     CrackedNews44 = true;
 }
Ejemplo n.º 7
0
 public void OnMessage(QuickFix.FIX44.News news, SessionID sessionID)
 {
     ProcessNews(news, sessionID);
 }
Ejemplo n.º 8
0
 private void SendNewsWithUtf()
 {
     QuickFix.FIX44.News n = new QuickFix.FIX44.News();
     n.Header.SetField(new QuickFix.Fields.MessageEncoding("UTF-8"));
     n.Headline = new QuickFix.Fields.Headline("here's some utf: ole");
     n.EncodedHeadline = new QuickFix.Fields.EncodedHeadline("here's some utf: olé");
     n.LinesOfText = new QuickFix.Fields.LinesOfText(0);
     Session.SendToTarget(n, _session.SessionID);
 }
Ejemplo n.º 9
0
 private void SendNewsWithoutUtf()
 {
     QuickFix.FIX44.News n = new QuickFix.FIX44.News();
     n.Headline = new QuickFix.Fields.Headline("it's all ascii here, bro");
     n.LinesOfText = new QuickFix.Fields.LinesOfText(0);
     Session.SendToTarget(n, _session.SessionID);
 }