SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Thu Sep 24, 2020 10:56 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: IQFeed Bug
PostPosted: Thu Oct 03, 2013 1:26 am 
Offline

Joined: Sat Jul 13, 2013 3:57 am
Posts: 52
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)


Top
 Profile  
 
 Post subject: Re: IQFeed Bug
PostPosted: Thu Oct 03, 2013 5:09 pm 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 578
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?


Top
 Profile  
 
 Post subject: Re: IQFeed Bug
PostPosted: Thu Oct 03, 2013 10:03 pm 
Offline

Joined: Sat Jul 13, 2013 3:57 am
Posts: 52
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()


Top
 Profile  
 
 Post subject: Re: IQFeed Bug
PostPosted: Wed Jan 15, 2014 1:46 pm 
Offline

Joined: Mon Oct 04, 2010 5:13 pm
Posts: 362
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 196 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group