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

disable SIO_UDP_CONNRESET behaviour for UDP #67

Merged
merged 2 commits into from
Jul 9, 2023

Conversation

silbinarywolf
Copy link
Contributor

  • Disable SIO_UDP_CONNRESET behaviour for UDP sockets
  • Add test to catch error error.Unexpected: GetLastError(10054): An existing connection was forcibly closed by the remote host. if SIO_UDP_CONNRESET disable code is not present.

Example of error thrown without this PR:

error.Unexpected: GetLastError(10054): An existing connection was forcibly closed by the remote host.

C:\zig\current\lib\std\os\windows.zig:2335:27: 0x7ff7d228a286 in unexpectedWSAError (test.exe.obj)
    return unexpectedError(@as(Win32Error, @enumFromInt(@intFromEnum(err))));
                          ^
D:\ZigProjects\zig-network\network.zig:1485:60: 0x7ff7d22943a8 in recvfrom (test.exe.obj)
                    else => |err| return unexpectedWSAError(err),
                                                           ^
D:\ZigProjects\zig-network\network.zig:505:36: 0x7ff7d22d55a7 in receiveFrom (test.exe.obj)
        const len = try recvfrom_fn(self.internal, data, flags | if (is_windows) 0 else 4, addr_ptr, &size);
                                   ^
D:\ZigProjects\zig-network\testsuite.zig:112:54: 0x7ff7d22d57ce in thread_fn (test.exe.obj)
                    const recvFrom = sock.receiveFrom(server_msg[0..buflen]) catch |err| switch (err) {

Fixes #66

@ikskuh ikskuh merged commit 04fc378 into ikskuh:master Jul 9, 2023
@ikskuh
Copy link
Owner

ikskuh commented Jul 9, 2023

Thanks for fixing that!

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

Successfully merging this pull request may close these issues.

Windows specific crash bug where WSAECONNRESET can occur randomly with UDP sockets client/host
2 participants