Skip to content

error UDP socket #26518

Closed
Closed
@dev-priporov

Description

@dev-priporov

I have that code:

fn main() {
    let socket = UdpSocket::bind("127.0.0.1:23451").ok().expect("fail bind");
    let mut buf = [0; 2];
    buf[0]=11;
    buf[1]=22;
    socket.send_to(&buf, "127.0.0.1:23451").ok().expect("fail send");
    println!("{:?}", buf);
}

and I start it in 2 different PC with OS win7 32 , and have 2 different error:
1)thread '' panicked at 'called Result::unwrap() on an Err value: Error { repr: Os(10022) }',
C:/bot/slave/stable-dist-rustc-win-32/build/src/libcore\result.rs:729
2)thread '' panicked at 'fail bind', C:/bot/slave/stable-dist-rustc-win-32/b
uild/src/libcore\option.rs:330
This errors com in after first string:

let socket = UdpSocket::bind("127.0.0.1:23451").ok().expect("fail bind");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions