{{Quickfixn}} SocketInitiator.SocketInitiatorThreadStart()

Dominique Normand dominique.normand at gmail.com
Mon Jun 6 06:07:29 PDT 2016


Hi there,

 

I have had some trouble getting my trading platform properly stop in some
circumstances. After investigating, I found the QuickFix/n could get stuck
in the "infinite" loop of SocketInitiatorThreadStart(), which I updated as
below :

 

 

        public static void SocketInitiatorThreadStart(object
socketInitiatorThread)

        {

            SocketInitiatorThread t = socketInitiatorThread as
SocketInitiatorThread;

            if (t == null) return;

            try

            {

                t.Connect();

                t.Initiator.SetConnected(t.Session.SessionID);

                t.Session.Log.OnEvent("Connection succeeded");

                t.Session.Next();

                while (t.Read())

                {

                    if (t.Initiator.IsStopped) break; // D.Normand

                }

                if (t.Initiator.IsStopped)

                    t.Initiator.RemoveThread(t);

                t.Initiator.SetDisconnected(t.Session.SessionID);

            }

            catch (.)

 

 

 

Regards

Dominique Normand

  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20160606/d813eb5f/attachment.htm>


More information about the Quickfixn mailing list