Re: [Quickfix-developers] Intermittent disconnects on Solaris
Brought to you by:
orenmnero
From: Caleb E. <cal...@gm...> - 2005-03-21 19:20:36
|
On Mon, 21 Mar 2005 19:02:19 -0000, kri...@rb... <kri...@rb...> wrote: > I have isolated the cause of the intermittent disconnects caused by QuickFIX on Solaris. The problem was due to the use of the I_NREAD ioctl to determine whether a readable socket was EOF or not. > > In certain circumstances which seem to involve high network traffic and low machine load, I_NREAD will return zero for a readable socket that actually has data. In such cases, QuickFIX would erroneously close the socket. > > I replaced the I_NREAD code in socket_disconnected() one byte recv() with the MSG_PEEK flag. This appears to have resolved this rather troublesome issue for us in production. > Shouldn't QuickFIX just rely on recv returning 0 to detect a socket disconnect, instead of relying on this ioctl? I've never seen a socket-based application using this technique to detect disconnects before. Clearly its not 100% reliable. -- Caleb Epstein caleb dot epstein at gmail dot com |