-
Notifications
You must be signed in to change notification settings - Fork 11
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
🧵 Threadless network transports #119
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me so far :)
There's definitely a regression here where when I first connect it fails and if I connect again quickly it works, but if I wait a bit it fails again, unsure why |
The connect fail was a race condition because the jthread member was before the regex members so I think sometimes the CONNECT regex would not be initialized in time and the match would always fail. There is another issue with the shutdown order, it SEGV's:
|
Fixed the SEGV, think this might be ready to merge. |
test/unit/ConnectionTransports/NetworkSocketConnectionTransportTests.cpp
Outdated
Show resolved
Hide resolved
test/unit/ConnectionTransports/NetworkSocketConnectionTransportTests.cpp
Outdated
Show resolved
Hide resolved
Thanks for working through this big change with me. It works great on my home lab, think it's time to merge! |
This makes the network transport layer very dumb, the media/control connection classes now have threads that monitor and drive the streams.
This has a few benefits:
Stop()
methods now ask thejthread
to stop, it asynchronously does and then calls the onClose callbacks. This should be more reliable than making the original thread which asked for the stop to do all that work (which had often lead to deadlocks)I also did a bit of cleanup to use the more modern
scoped_lock
, etc.Ready for initial reviews but there's still a couple TODOs and I'd like to do more testing before declaring it ready to merge.