Zig Version
0.15.2
Steps to Reproduce and Observed Behavior
Steps to reproduce
- Create a TCP server using
std.net - Accept a client connection
- Attempt to read from the stream using
stream.read() - The read operation fails with
error.Unexpected
Actual Behaviour
The read() call fails with:
error.Unexpected: GetLastError(87): The parameter is incorrect.
The stack trace shows:
C:\Users\...\.zvm0円.15.2\lib\std\os\windows.zig:648:53: 0x... in ReadFile
else => |err| return unexpectedError(err),
^
C:\Users\...\.zvm0円.15.2\lib\std\posix.zig:847:32: 0x... in read
return windows.ReadFile(fd, buf, null);
^
Expected Behavior
The read() call should successfully read data from the socket stream, returning the number of bytes read.
More
Originally opened in websocket.zig repo https://github.com/karlseguin/websocket.zig/issues/89
### Zig Version
0.15.2
### Steps to Reproduce and Observed Behavior
## Steps to reproduce
1. Create a TCP server using `std.net`
2. Accept a client connection
3. Attempt to read from the stream using `stream.read()`
4. The read operation fails with `error.Unexpected`
## Actual Behaviour
The `read()` call fails with:
```
error.Unexpected: GetLastError(87): The parameter is incorrect.
```
The stack trace shows:
```
C:\Users\...\.zvm0円.15.2\lib\std\os\windows.zig:648:53: 0x... in ReadFile
else => |err| return unexpectedError(err),
^
C:\Users\...\.zvm0円.15.2\lib\std\posix.zig:847:32: 0x... in read
return windows.ReadFile(fd, buf, null);
^
```
### Expected Behavior
The `read()` call should successfully read data from the socket stream, returning the number of bytes read.
## More
Originally opened in websocket.zig repo https://github.com/karlseguin/websocket.zig/issues/89