12

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

tshepang
  • 12,111
  • 21
  • 91
  • 136
Matt Joiner
  • 112,946
  • 110
  • 377
  • 526

3 Answers3

11

The std::net exists for working with sockets.

Vladimir Matveev
  • 120,085
  • 34
  • 287
  • 296
ion
  • 819
  • 10
  • 8
  • 1
    @RüdigerHerrmann, this does provide an answer. Since the question was asked, sockets support was added to `std::net` module in the standard library. – Vladimir Matveev Oct 06 '15 at 08:24
7

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.

Erick Tryzelaar
  • 104
  • 1
  • 2
0

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.

brasofilo
  • 25,496
  • 15
  • 91
  • 179
diannne
  • 9
  • 1