Skip to content

win: prefer LPFN_CONNECTEX for asynchronous connect calls #151

Open
@nikneym

Description

@nikneym

Currently connect is used on Windows to establish connections. This is a blocking call, WinSock 2 offers LPFN_CONNECTEX (that take OVERLAPPED) for asynchronous connect calls.

libxev/src/backend/iocp.zig

Lines 540 to 549 in 07bcffa

.connect => |*v| action: {
const result = windows.ws2_32.connect(asSocket(v.socket), &v.addr.any, @as(i32, @intCast(v.addr.getOsSockLen())));
if (result != 0) {
const err = windows.ws2_32.WSAGetLastError();
break :action switch (err) {
else => .{ .result = .{ .connect = windows.unexpectedWSAError(err) } },
};
}
break :action .{ .result = .{ .connect = {} } };
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions