Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't properly send data through Write. #7

Open
nyovaya opened this issue Jan 17, 2019 · 2 comments
Open

Can't properly send data through Write. #7

nyovaya opened this issue Jan 17, 2019 · 2 comments

Comments

@nyovaya
Copy link

nyovaya commented Jan 17, 2019

On the client I sent data through SctpStream's Write impl.
On the server side I tried to read it using:

let sock = sctp::SctpEndpoint::bind("127.0.0.1:2000").unwrap();
loop{
let mut v = Vec::new();
sock.recv_from(&mut v[..]).unwrap();
println!("msg: {}", std::str::from_utf8(&v[..]).unwrap());
}

This returns the error:

thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 0, kind: Other, message: "Success" }', libcore/result.rs:1009:5

@nyovaya
Copy link
Author

nyovaya commented Jan 18, 2019

Ok it was because the slice's size is 0 - I don't like the Error message, it should return a proper error message when the len is 0.

@nyovaya
Copy link
Author

nyovaya commented Jan 22, 2019

I would create a PR - @phsym still working on this one? - I have others additions too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant