Skip to content

Commit

Permalink
Update to mio 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nbaksalyar committed Oct 12, 2015
1 parent d27bdc2 commit af8c5e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

A scalable Chat Service implemented in Rust!

Read the blog post: [Rust in Detail: Writing Scalable Chat Service from Scratch](http://nbaksalyar.github.io/2015/07/10/writing-chat-in-rust.html)
Read the blog post: [Rust in Detail: Writing Scalable Chat Service from Scratch](http://nbaksalyar.github.io/2015/07/10/writing-chat-in-rust.html) (на [русском](http://habrahabr.ru/post/268609/)).
8 changes: 2 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl Handler for WebSocketServer {
match token {
SERVER_TOKEN => {
let client_socket = match self.socket.accept() {
Ok(Some(sock)) => sock,
Ok(Some((sock, addr))) => sock,
Ok(None) => unreachable!(),
Err(e) => {
println!("Accept error: {}", e);
Expand Down Expand Up @@ -176,12 +176,8 @@ impl Handler for WebSocketServer {
}

fn main() {
let server_socket = TcpSocket::v4().unwrap();

let address = "0.0.0.0:10000".parse::<SocketAddr>().unwrap();
server_socket.bind(&address).unwrap();

let server_socket = server_socket.listen(256).unwrap();
let server_socket = TcpListener::bind(&address).unwrap();

let mut event_loop = EventLoop::new().unwrap();

Expand Down

0 comments on commit af8c5e0

Please sign in to comment.