Skip to content

Commit 010acb1

Browse files
author
pierresy
committed
Added "How to build" in readme
1 parent f104d59 commit 010acb1

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@
77
[Documentation](http://phsym.github.io/rust-sctp)
88

99
SCTP networking library for Rust
10+
11+
# How to build
12+
13+
`rust-sctp` relies on the [sctp-sys](https://crates.io/crates/sctp-sys) crate. Please have a look at [sctp-sys: How to build](https://github.com/phsym/sctp-sys#how-to-build).
14+

examples/stream.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ fn main() {
88
match SctpStream::connect("127.0.0.1:3868") {
99
Err(e) => println!("{:?}", e.kind()),
1010
Ok(mut peer) => {
11+
// Set SCTP no delay
12+
peer.set_nodelay(true).unwrap();
1113
// Write a message using the io::Write trait
12-
peer.write_all("foo bar".as_bytes()).unwrap();
14+
peer.write_all("foo bar\n".as_bytes()).unwrap();
1315
// Write a message on stream 6
14-
peer.sendmsg("foo bar again".as_bytes(), 6).unwrap();
16+
peer.sendmsg("foo bar again\n".as_bytes(), 6).unwrap();
1517
let mut data = [0u8; 1024];
1618
// Read data using the io::Read trait
1719
peer.read(&mut data).unwrap();

src/sctpsock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ impl SctpSocket {
351351
/// Try to clone this socket
352352
pub fn try_clone(&self) -> Result<SctpSocket> {
353353
unsafe {
354-
let new_sock = try!(check_socket(libc::dup(self.0 as i32)as SOCKET ));
354+
let new_sock = try!(check_socket(libc::dup(self.0 as i32) as SOCKET));
355355
return Ok(SctpSocket(new_sock));
356356
}
357357
}

0 commit comments

Comments
 (0)