Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non blocking implementation #118

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

YarekTyshchenko
Copy link
Contributor

@YarekTyshchenko YarekTyshchenko commented Dec 7, 2022

  • Remove casting of BacnetAsyncResult to IAsyncResult
  • Add WIP Async method that uses new non-blocking code

Should partly address issues in #46 allowing the library to be used with concurrent queries, as long as invokeId issues are handled externally

Some questions about the changes:

  • How to deal with breaking changes to the API? The library makes far too many things public, so its impossible to know if any of them are used. Perhaps upping the major version, or keeping changes branched?
  • ManualResetEvent is used in LastSegmentAck, but in my tests I haven't been able to trigger that codepath
  • I don't know how well this plays with other transport protocols, I've only extensively tested UDP

The package is published temporarily here: https://www.nuget.org/packages/BACnet-fork-yarekt/

Using that interface prevents any meaningful refactoring towards task
based system
ManualResetEvent blocks threads. Since network read operations can be
done in a true non-blocking fashion, using MRE needlessly blocks
threads.
@YarekTyshchenko YarekTyshchenko marked this pull request as ready for review February 9, 2023 11:35
@YarekTyshchenko YarekTyshchenko changed the title WIP Non blocking implementation Non blocking implementation Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant