soio
Soio is a I/O library for Rust.
Document
Usage
First, add this to your Cargo.toml:
[]
= "0.1"
Then, add this to your crate root:
extern crate soio:
Example:
use ;
use TcpStream;
use ;
// Bind a server socket to connect to.
let addr: SocketAddr = "127.0.0.1:0".parse.unwrap;
let server = bind.unwrap;
// Construct a new `Poll` handle as well as the `Events` we'll store into
let poll = new.unwrap;
let mut events = with_capacity;
// Connect the stream
let stream = connect.unwrap;
// Register the stream with `Poll`
poll.register.unwrap;
// Wait for the socket to become ready. This has to happens in a loop to
// handle spurious wakeups.
loop
Feature
- Bakced by epoll kqueue
- Non-blocking TCP, UDP sockets
- Thread safe message channel for cross thread communication
Platforms
- Linux
- OS X
- NetBSD
- Android
- iOS