SmartQuant Discussion
http://www.smartquant.com/forums/

IQFeed Bug
http://www.smartquant.com/forums/viewtopic.php?f=60&t=10601
Page 1 of 1

Author:  bean3178 [ Thu Oct 03, 2013 1:26 am ]
Post subject:  IQFeed Bug

If I'm logged into IQFeed in one instance of QuantTrader, then I start a strategy that loads historical data in another QuantTrader instance using the same IQFeed credentials, the first instance running/connected to IQFeed disconnects and shows a notice as it should. But, I then get this crash:

Code:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
   at System.Net.Sockets.Socket.Shutdown(SocketShutdown how)
   at OpenQuant.IQ.IQFeed.OnReceive(IAsyncResult asyn)
   at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   at System.Net.ContextAwareResult.CompleteCallback(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.ContextAwareResult.Complete(IntPtr userToken)
   at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

Author:  skuvv [ Thu Oct 03, 2013 5:09 pm ]
Post subject:  Re: IQFeed Bug

bean3178 wrote:
If I'm logged into IQFeed in one instance of QuantTrader, then I start a strategy that loads historical data in another QuantTrader instance using the same IQFeed credentials, the first instance running/connected to IQFeed disconnects and shows a notice as it should. But, I then get this crash:

Code:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
   at System.Net.Sockets.Socket.Shutdown(SocketShutdown how)
   at OpenQuant.IQ.IQFeed.OnReceive(IAsyncResult asyn)
   at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   at System.Net.ContextAwareResult.CompleteCallback(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.ContextAwareResult.Complete(IntPtr userToken)
   at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

Hello.
Can you please post here full log with this error?
Did you use both QuantTraders on one PC or on several PC?

Author:  bean3178 [ Thu Oct 03, 2013 10:03 pm ]
Post subject:  Re: IQFeed Bug

I have QuantTrader running on 2 different PC's.

I believe this is what you're looking for:

Code:
16:19:36.521 Connection status changed: Disconnected
16:19:37.535 S,SERVER DISCONNECTED
17:21:28.298 [OnReceive] *error* <History>: An existing connection was forcibly closed by the remote host
17:21:28.298 System.Net.Sockets.SocketException
17:21:28.298 [OnReceive] *error* <Level1>: An existing connection was forcibly closed by the remote host
17:21:28.298 System.Net.Sockets.SocketException
17:21:28.298    at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at OpenQuant.IQ.IQFeed.OnReceive(IAsyncResult asyn)
17:21:28.298 data: 
17:21:28.298 Socket ErrorCode: 10054
17:21:28.298    at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at OpenQuant.IQ.IQFeed.OnReceive(IAsyncResult asyn)
17:21:28.298 data: 
17:21:28.298 Socket ErrorCode: 10054
17:21:28.329 History socket shutdown started (by exception)
17:21:28.329 History socket shutdown completed (by exception)
17:21:28.329 History socket close started (by exception)
17:21:28.329 History socket close completed (by exception)
17:21:28.329 History socket shutdown started (by exception)
17:21:28.360 L1 socket shutdown started (by exception)
17:21:28.360 L1 socket shutdown completed (by exception)
17:21:28.360 L1 socket close started (by exception)
17:21:28.360 L1 socket close completed (by exception)
17:21:28.360 Thread Run stop
17:21:28.391 L2 socket shutdown started (by exception)
17:21:28.391 L2 socket shutdown completed (by exception)
17:21:28.391 L2 socket close started (by exception)
17:21:28.391 L2 socket close completed (by exception)
17:21:28.391 L2 socket shutdown started (by Thread Run stop)
17:21:28.391 [dataThread] *error* Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
17:21:28.391    at System.Net.Sockets.Socket.Shutdown(SocketShutdown how)
   at OpenQuant.IQ.IQFeed.Run11()

Author:  edwardgonen [ Wed Jan 15, 2014 1:46 pm ]
Post subject:  Re: IQFeed Bug

Hi,

Any findings on this issue with disposed object and socket exceptions. I'm attaching here my log. The problem was that the IQFeed real-time feed has stopped yesterday.

Another question - in the code I don't do anything special at the OnDisconnected method. Now I'm going to do the following:


Is that correct approach?
Code:
       
        public override void OnDisconnected(String provider)
        {
            Logger.Instance.Log(LogLevel.FATAL, Instrument.Symbol + " OnDisconnected: Provider has been disconnected: " + provider);
            //try to reconnect
            if (!MarketDataProvider.IsConnected) MarketDataProvider.Connect();
            if (!ExecutionProvider.IsConnected) ExecutionProvider.Connect();
        }


Attachments:
IQfeed.zip [3.75 KiB]
Downloaded 195 times

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/