<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.hoenzb
{mso-style-name:hoenzb;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I haven’t gone digging into the history of conversations about Stop(…) … but I do have something to add.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Recently, for our FIX service based on QuickFixN, we were working on the ability to remotely control the service to spin up and spin down on-demand. What we
found was that it was simple enough to do, but we could not get a new initiator from QuickFixN when it spun back up. The reason was because the old thread was holding onto handles to files that weren’t being properly disposed of.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">So I push IDisposable around a bit in the code. Rather than build that into the Stop method (which I feel is the natural place for it / intent of it), I built
an additional method called Dispose which does the work. That way you can choose if you want to actually properly dispose of things or not. I’m happy to share the changes and then perhaps others with more history on the project could consider how best to make
sure the system properly disposes of handles and threads and such?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> - Christian<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> quickfixn-bounces@lists.quickfixn.com [mailto:quickfixn-bounces@lists.quickfixn.com]
<b>On Behalf Of </b>Ruaan Viljoen<br>
<b>Sent:</b> Monday, September 10, 2012 10:52 AM<br>
<b>To:</b> Mailing list for QuickFIX/n<br>
<b>Subject:</b> Re: {{Quickfixn}} Force close quickfixn<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I have been poking around in the Quickfix source to try and see what the issue is with the initiator.Stop(true) not actually logging out or ending
the thread.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I found something that I don’t quite understand:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">In AbstractInitiator.cs<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif"">public void Stop(bool force)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif"">{<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif"">…<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:.5in"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif"">isStopped_ = true;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> OnStop();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> thread_.Join(5000);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> thread_ = null;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> foreach (Session session in enabledSessions)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> session.Logon();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif"">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">What is this ‘session.Logon();’ doing in here?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Also regarding the issue that sessions are not logging out on Stop(true):<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> public void Logout()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> Logout("");<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> public void Logout(string reason)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> state_.IsEnabled = false;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> state_.LogoutReason = reason;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:10.0pt;font-family:"Calibri","sans-serif""> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I don’t quite see where the actual logout is being sent. Could this be one of the issues. I realize this might be asking you guys to get more involved
that you have time for right now, but perhaps someone else can help shed some light.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Ruaan<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">
<a href="mailto:quickfixn-bounces@lists.quickfixn.com">quickfixn-bounces@lists.quickfixn.com</a>
<a href="mailto:[mailto:quickfixn-bounces@lists.quickfixn.com]">[mailto:quickfixn-bounces@lists.quickfixn.com]</a>
<b>On Behalf Of </b>Grant Birchmeier<br>
<b>Sent:</b> 07 September 2012 04:14 PM<br>
<b>To:</b> Mailing list for QuickFIX/n<br>
<b>Subject:</b> Re: {{Quickfixn}} Force close quickfixn<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-ZA"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-ZA" style="color:black">This is open issue 45. (48 is also related.)</span><span lang="EN-ZA"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-ZA"><a href="https://github.com/connamara/quickfixn/issues">https://github.com/connamara/quickfixn/issues</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-ZA"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-ZA"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-ZA">On Fri, Sep 7, 2012 at 2:49 AM, Ruaan Viljoen <<a href="mailto:ruaanv@estuarys.co.za" target="_blank">ruaanv@estuarys.co.za</a>> wrote:<o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-ZA">Hi,<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-ZA"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-ZA">I remember some issue with the initiator.stop(true) a while ago, has these issues been resolved?<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-ZA"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-ZA">I am calling intitiator.stop(true), but the thread is still staying alive it seems, and needs to be closed by end-tasking it. I am going to download the full
quickfix/n from the repo now and see what exactly is causing this.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-ZA"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-ZA">However I thought I would ask, maybe someone has a simple explanation?<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-ZA" style="color:#595959"> </span><span lang="EN-ZA"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-ZA" style="color:#595959">Groete</span><span lang="EN-ZA"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-ZA" style="color:#595959">Regards</span><span lang="EN-ZA"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-ZA" style="color:#888888"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-ZA" style="color:#595959">Ruaan Viljoen</span></b><span lang="EN-ZA" style="color:#888888"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-ZA"><br>
_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-ZA"><br>
<br clear="all">
<br>
-- <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-ZA" style="background:white">Grant Birchmeier</span><span lang="EN-ZA"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span lang="EN-ZA" style="color:#3333FF;background:#FFCC00">Connamara Systems, LLC</span></b><span lang="EN-ZA"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span lang="EN-ZA">Made-To-Measure Trading Solutions.</span></b><span lang="EN-ZA"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-ZA">Exactly what you need. No more. No less.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-ZA"><a href="http://connamara.com" target="_blank">http://connamara.com</a><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-ZA"><o:p> </o:p></span></p>
</div>
</body>
</html>