mathpaquette / IQFeed.CSharpApiClient

IQFeed.CSharpApiClient is fastest and the most well-designed C# DTN IQFeed socket API connector available
MIT License
120 stars 43 forks source link

IQFeed client causes app crash #123

Open samushenkov opened 3 years ago

samushenkov commented 3 years ago

122 issue can cause app crash if one uses GetIntervalMessagesWithRequestId api method.

SocketAsyncEventArgs.Completed event handler doesn't have any try-catch blocks. That is why exception thrown by ParseWithRequestId crashes all application.

mathpaquette commented 3 years ago

@samushenkov just by curiosity, why are you still using requestId?

samushenkov commented 3 years ago

Actually I am not, it was a first attempt to solve an issue with candles received from previous request. Just thought that there is some logic that filters messages based on request id.

mathpaquette commented 3 years ago

@samushenkov we still dont use TryParse for RequestId thats the reason why you got the exception. https://github.com/mathpaquette/IQFeed.CSharpApiClient/blob/master/src/IQFeed.CSharpApiClient/Lookup/Historical/HistoricalMessageHandler.cs#L27