سؤال

Are there any socket or net libraries for Rust? The net page in the standard library documentation seems to only include address-related functions.

هل كانت مفيدة؟

المحلول

The std::net exists for working with sockets.

نصائح أخرى

There is also a bsd socket library in cargo, which you can install with:

$ cargo install socket

I haven't tried it out yet though. Or if you want to use zeromq, you could use my bindings. You'll need to be using rust's HEAD version though, as it's using code that was added after the rust 0.1 release. Feel free to ping me on irc.mozilla.org's #rust channel if you need any help. I'm erickt there.

You can try UnixListener from the tokio crate.

This crate provides bindings between mio_uds, the mio crate for Unix Domain sockets, and futures. The APIs and bindings in this crate are very similar to the TCP and UDP bindings in the futures-mio crate. This crate is also an empty crate on Windows, as Unix Domain Sockets are Unix-specific.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top