forked from housleyjk/ws-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d51eaed
commit 2e3ac59
Showing
37 changed files
with
1,705 additions
and
1,406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
use_try_shorthand = true | ||
error_on_line_overflow = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,25 @@ | ||
extern crate env_logger; | ||
/// WebSocket server used for testing against the Autobahn Test Suite. This is basically the server | ||
/// example without printing output or comments. | ||
extern crate ws; | ||
extern crate env_logger; | ||
|
||
#[cfg(feature="permessage-deflate")] | ||
#[cfg(feature = "permessage-deflate")] | ||
use ws::deflate::DeflateHandler; | ||
|
||
#[cfg(not(feature="permessage-deflate"))] | ||
fn main () { | ||
#[cfg(not(feature = "permessage-deflate"))] | ||
fn main() { | ||
env_logger::init(); | ||
|
||
ws::listen("127.0.0.1:3012", |out| { | ||
move |msg| { | ||
out.send(msg) | ||
} | ||
move |msg| out.send(msg) | ||
}).unwrap() | ||
} | ||
|
||
#[cfg(feature="permessage-deflate")] | ||
fn main () { | ||
#[cfg(feature = "permessage-deflate")] | ||
fn main() { | ||
env_logger::init(); | ||
|
||
ws::listen("127.0.0.1:3012", |out| { | ||
DeflateHandler::new(move |msg| { | ||
out.send(msg) | ||
}) | ||
DeflateHandler::new(move |msg| out.send(msg)) | ||
}).unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
|
||
/// WebSocket server used for testing the bench example. | ||
extern crate ws; | ||
|
||
use ws::{Builder, Settings, Sender}; | ||
use ws::{Builder, Sender, Settings}; | ||
|
||
fn main () { | ||
Builder::new().with_settings(Settings { | ||
max_connections: 10_000, | ||
..Settings::default() | ||
}).build(|out: Sender| { | ||
move |msg| { | ||
out.send(msg) | ||
} | ||
}).unwrap().listen("127.0.0.1:3012").unwrap(); | ||
fn main() { | ||
Builder::new() | ||
.with_settings(Settings { | ||
max_connections: 10_000, | ||
..Settings::default() | ||
}) | ||
.build(|out: Sender| move |msg| out.send(msg)) | ||
.unwrap() | ||
.listen("127.0.0.1:3012") | ||
.unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.