jhelovuo / RustDDS

Rust implementation of Data Distribution Service
Apache License 2.0
319 stars 65 forks source link

No Windows support for latest version for RustDDS #264

Closed julian-engelberger-bl closed 10 months ago

julian-engelberger-bl commented 1 year ago

Hi, I tried to compile the latest version of RustDDS, however src/mio_source/mod.rs uses os::fd::{AsRawFd, FromRawFd, OwnedFd} which is not available under Windows.

jhelovuo commented 1 year ago

Yes, this is a semi-accidental change due to mio-0.8 support.

We need to send notifications from the background thread to the application thread. In order to poll these notifications with mio-0.8, there needs to be an OS file descriptor that can be polled to detect a notification. We use a socketpair to do this, so a dummy piece of data is sent over a socketpair. This can then be polled with mio to detect that there is an event available.

The setup of socket pairs to do this was not fully portable from Linux to Windows. Do you have means to fix this and propose a PR? It should be sufficient to fix only the mio_source module.

phil-opp commented 1 year ago

Was this fixed by https://github.com/jhelovuo/RustDDS/pull/290?

kandersonpeng commented 1 year ago

My previous comment was useless. When you specify the dependency to the github repository, it appears to build. to do that in Cargo.toml, use a line similar to this:

rustdds= { git="https://github.com/jhelovuo/RustDDS.git" }

Seems to build now from the latest master. Probably that PR that did it, but it's not released either, so you can't pull just from crates.io.

samcarey commented 1 year ago

The master branch works for me on Windows. Perhaps it's time for a minor version release on crates.io?