We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
// service use ws::listen; fn main() { // error code if let Err(err) = listen("[::]:3012", |out| { // correct code // if let Err(err) = listen("0.0.0.0:3012", |out| { move |msg| { println!("server receive: '{}'.", msg); let new_msg = format!("you:{}!!", msg); println!("server return message '{}'.", new_msg); out.send(new_msg) } }) { println!("Fail create WebSocket connection due to error: {:?}", err) } println!("service over") }
// client use ws::{connect, CloseCode}; fn main() { // error code if let Err(err) = connect("ws://[::1]:3012", |out| { // correct code // if let Err(err) = connect("ws://127.0.0.1:3012", |out| { if out.send("Hello").is_err() { println!("Failed"); } else { println!("Client send Hello") } move |msg| { println!("Client receive: '{}'.", msg); out.close(CloseCode::Normal) } }) { println!("Fail create WebSocket connection due to error: {:?}", err); } println!("client over"); }
Run error when url is "ws://[::1]:3012". Run correctly when url is "ws://127.0.0.1:3012".
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Run error when url is "ws://[::1]:3012".
Run correctly when url is "ws://127.0.0.1:3012".
The text was updated successfully, but these errors were encountered: