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

Fix issue with disposed socket during receive #158

Closed NichUK closed 11 months ago

NichUK commented 11 months ago

I had a problem with an uncatchable ObjectDisposedException occurring occasionally during receive, usually when I was closing a connection.

The client socket is obviously being disposed during the receive operation, and thus isn't caught by the disposed check.

The extra two layers of test and catch seems to have fixed it for us, although @mathpaquette might have a more elegant fix.

Nich

mathpaquette commented 11 months ago

thanks !!

NichUK commented 11 months ago

You're welcome. I meant to PR it a few weeks ago, but got busy.