Looking through the source code, I note that BUF_SIZE for SocketInitiatorThread.cs and SocketReader.cs are 512 bytes and 4096 bytes. I wonder if these are too small for some TCP applications with low bandwidth and high latency? (That could be the cause of my SocketException.)<br>
<br>Perhaps there should be some configuration file option for these buffer sizes? And also TcpClient.SendBufferSize and TcpClient.ReceiveBufferSize.<br><br>Regards,<br>S<br><br><div class="gmail_quote">On Tue, Sep 11, 2012 at 12:48 AM, Stan <span dir="ltr"><<a href="mailto:stan.quickfixn@gmail.com" target="_blank">stan.quickfixn@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all, I am porting a server program originally written with QuickFIX C++ .Net wrapper to QuickFIX/n. It worked well for several hours until it suddenly crashed with this SocketException (extracted from Event Viewer):<br>

<br><div style="margin-left:40px"><span style="font-family:courier new,monospace">Framework Version: v4.0.30319<br>Description: The process was terminated due to an unhandled exception.<br>Exception Info: System.Net.Sockets.SocketException<br>

Stack:<br>   at System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)<br>   at QuickFix.ClientHandlerThread.Send(System.String)<br>   at QuickFix.Session.Send(System.String)<br>   at QuickFix.Session.SendRaw(QuickFix.Message, Int32)<br>

   at QuickFix.Session.Send(QuickFix.Message)<br>   at QuickFix.Session.SendToTarget(QuickFix.Message, QuickFix.SessionID)<br>   at MyProg.SendData(System.Collections.Generic.List`1<NoMDEntriesGroup>)<br>   ...</span><br>

</div><br>I am guessing the SocketException could be due to various reasons, e.g. TCP buffer full, client disconnected, etc. That happens on a busy network. <br><br>What I would like to know though is how I should handle this issue. Do I need to put a try-catch around ALL calls to Session.SendToTarget? I've never did this in the server program when using the .Net wrapper and have assumed that SendToTarget would always return gracefully with false if it failed to send. What is the recommended best practice? Advice and suggestions are most appreciated.<br>

<br>Regards,<br>S<br>
<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><br>
<br></blockquote></div><br>