Skip to content

Async::<TcpStream>::connect fails on windows #182

@gzmorell

Description

@gzmorell

connect fails on windows with "Either the application has not called WSAStartup, or WSAStartup failed."

According to "https://docs.rs/rustix/0.38.30/x86_64-pc-windows-msvc/rustix/net/fn.wsa_startup.html"
pub fn wsa_startup() -> Result
"On Windows, it’s necessary to initialize the sockets subsystem before using sockets APIs. The function performs the necessary initialization."
Calling this function before trying to connect solves the problem.

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