IQFeed.CSharpApiClient
IQFeed.CSharpApiClient copied to clipboard
Exception happens on ReqWatchList call
Calling ReqWatchList
produces exceptions:
Unhandled exception. [System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
at System.IO.MemoryStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at IQFeed.CSharpApiClient.Socket.SocketMessageHandler.TryRead(Byte[]& output)
It happens when there are a lot of symbols. I tried 1300 options symbols. After some debugging, I figured out that the size of the buffer is not enough.
Increasing _readBytes
solves the issue, quick fix:
_readBytes = new byte[bufferSize * 3];
@sharok thanks for rising this. could you please refresh my mind on what it does exactly? just returns a list of currently watched symbols?
usually I give the opportunity to increase the buffer size through the factory. Let me add that as well for Level1
@mathpaquette Yes, it just returns watching symbols.