Last active
September 3, 2015 22:05
-
-
Save benaryorg/0eed26b88b71eea4bed0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
extern crate sctp; | |
use sctp::SctpEndpoint; | |
fn main() | |
{ | |
let mut buf : Vec<u8> = Vec::new(); | |
let endpoint = SctpEndpoint::bind("localhost:1337").unwrap(); | |
println!("Meow."); | |
loop | |
{ | |
if let Ok((_len,_stream,_addr)) = endpoint.recv_from(&mut buf) | |
{ | |
if let Ok(msg) = String::from_utf8(buf.clone()) | |
{ | |
println!("Message: \"{}\"",msg); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment