<div dir="ltr">Mark,<div><br></div><div>You'll want to at least put a sleep in that loop, e.g.: <font face="monospace" style="background-color:rgb(238,238,238)">Thread.Sleep(2000);</font> </div><div><br></div><div>And you might use a bool in your while loop to allow for an orderly shutdown, instead of doing <font face="monospace" style="background-color:rgb(238,238,238)">while(true)</font>. But that's up to you, and depends on the rest of your app's architecture.</div><div><br></div><div><span style="font-family:arial,helvetica,sans-serif">--</span><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><font face="arial, helvetica, sans-serif">Mike Gatny</font></div><div dir="ltr"><span style="font-family:arial,helvetica,sans-serif">Connamara Systems</span><br></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 28, 2020 at 12:53 PM Mark Smith <<a href="mailto:msmith@rpia.ca">msmith@rpia.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_-4524723950718919265WordSection1">
<p class="MsoNormal">Ah okay, thank you so much! So if I just want to sit and listen to messages, I should just enter a
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">while (true) <u></u><u></u></p>
<p class="MsoNormal">{<u></u><u></u></p>
<p class="MsoNormal">} <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">loop that does nothing?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b>From:</b> Quickfixn <<a href="mailto:quickfixn-bounces@lists.quickfixn.com" target="_blank">quickfixn-bounces@lists.quickfixn.com</a>>
<b>On Behalf Of </b>Mike Gatny<br>
<b>Sent:</b> Friday, February 28, 2020 10:28 AM<br>
<b>To:</b> Mailing list for QuickFIX/n <<a href="mailto:quickfixn@lists.quickfixn.com" target="_blank">quickfixn@lists.quickfixn.com</a>><br>
<b>Subject:</b> Re: {{Quickfixn}} Cannot launch an initiator app<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Fri, Feb 28, 2020 at 8:56 AM Mark Smith <<a href="mailto:msmith@rpia.ca" target="_blank">msmith@rpia.ca</a>> wrote:<u></u><u></u></p>
</div>
<div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;color:blue">using</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> (Initiator)</span><u></u><u></u></p>
<p class="MsoNormal" style="text-indent:0.5in">
<span style="font-size:9.5pt;font-family:Consolas;color:black">Initiator.Start();</span><u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">The Initiator's <b><span style="font-family:"Courier New"">Start()</span></b> method does not block. If you allow the main thread to continue outside of that
<b><span style="font-family:"Courier New"">using</span></b> block, your Initiator is going to be disposed, which is going to attempt to dispose your log files, etc... hence the error where the Initiator is trying to write to closed logs.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">You could enter a while loop (like <span style="font-family:"Courier New"">
Examples/TradeClient/TradeClientApp.cs </span>does), or block/wait on a condition, or both.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:Arial,sans-serif">--</span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span style="font-family:Arial,sans-serif">Mike Gatny</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Arial,sans-serif">Connamara Systems</span><u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(29,28,29);background:white">This email, along with any attachments, is confidential. If you believe you received this message in error, please contact the sender immediately and delete all copies
of the message. Thank you from Connamara Systems, LLC.</span><u></u><u></u></p>
</div>
<font size="2" face="Trebuchet MS" color="gray"><br>
<br>
This message contains information that is privileged and confidential. Please notify the sender immediately if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.<br>
If you no longer wish to receive future updates from RP Investment Advisors, you may withdraw your consent by clicking on
<a href="mailto:unsubscribe@rpia.ca?Subject=UNSUBSCRIBE" target="_blank">UNSUBSCRIBE</a> and then Send or by replying to this email with "UNSUBSCRIBE" in the subject line or body of the e-mail.</font>
</div>
_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com" target="_blank">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" rel="noreferrer" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><br>
</blockquote></div>
<br>
<span style="color:rgb(29,28,29);font-family:Slack-Lato,appleLogo,sans-serif;white-space:pre-wrap;background-color:white"><font size="2">This email, along with any attachments, is confidential. If you believe you received this message in error, please contact the sender immediately and delete all copies of the message. Thank you from Connamara Systems, LLC.</font></span>