-
Notifications
You must be signed in to change notification settings - Fork 364
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
Add event framework based on epoll, kqueue and select #1080
base: master
Are you sure you want to change the base?
Conversation
Oh, btw, I should add that I intend to use the CheckTypeAlignment module to do type-punning for the eventlist, so I don't have to expose the types that wepoll introduces. I also think that we can use the mechanism to hide platform implementation headers for other sources. I also intend to reorder ddsrt slightly so I can use ddsrt within the idl library etc. A WiP that I'm hacking together in some lost hours and spare time can be found here. |
Right, so this PR now also includes generating the utility functions used in |
The little |
745af2f
to
b49b50c
Compare
Right, so there's one or two compilation warnings but I have verified the netlink tool works on all supported platforms, which makes this a nice base I guess(?) Anyway, moving on to writing test cases now and then hopefully soonish get to replace stuff in ddsi's connection code. EDIT: also, on macos, with the sanitizer there seems to be a problem. |
Ok, rebased on #1086. Updated the eventlist implementation and added some tests for that. I should add more tests for the event loop itself, but I'll focus on implementing this in ddsi first. |
Signed-off-by: Jeroen Koekkoek <[email protected]>
Use dds_return_t as intented. A negative return value indicates the operation failed, a positive integer indicates the number of file descriptors ready for processing. Signed-off-by: Jeroen Koekkoek <[email protected]>
The generic abstration is unnecessary as it is only used in Windows specific code and only in one place. Much easier to call FormatMessage directly. Signed-off-by: Jeroen Koekkoek <[email protected]>
Signed-off-by: Jeroen Koekkoek <[email protected]>
The target name is used as a prefix in preprocessor macros, which would lead to compilation errors if the name contains characters that may not occur in C identifiers. Signed-off-by: Jeroen Koekkoek <[email protected]>
Tests all pass, so I think this is fine UDP wise(?) Not sure about TCP connections yet as I removed the listener thread, so I'll have to go and test that some more. There's a couple of small warnings (that's why the builds fail), but I think this is nearly there. Ran tests and verified netlink events on all platforms and with different polling mechanisms. |
The latest push makes TCP "work" again. |
Signed-off-by: Jeroen Koekkoek <[email protected]>
CQ# 23920 Signed-off-by: Jeroen Koekkoek <[email protected]>
Signed-off-by: Jeroen Koekkoek <[email protected]>
I am interested in the functionality of fallback interfaces in cyclone dds and #1518 linked this PR in this context. Are there any future plans to continue development here? |
This (draft) PR adds a prototype event framework implementation to replace
os_sockWaitset
from the ddsi sources. I have some code laying around to use epoll on Linux (and Windows through wepoll) and kqueue for macOS and FreeBSD. This also implements netlink events for Linux, Windows, macOS and FreeBSD. I threw in a temporarynetlink
tool to demonstrate those work as intended (basically what #471 intended to do too), but this also adds interface up/down and ipv4/ipv6 added/deleted events without requiring an extra thread (recv thread can handle those as well?). Anyway, it requires some polishing still, but the basics are there and I'm hoping to get some feedback on the design, etc. Also, @eboasson, now is probably a good time to issue a CQ for wepoll and (probably required) CMake's CheckTypeSize module. Both are BSD licensed, so that shouldn't be much of a problem(?)