Commits
- Remove WSAPoll/WSAPOLLFD/POLL from ws2_32.zig (unused since std.posix.poll)\n- Fall through both NOT_SUPPORTED and OBJECT_TYPE_MISMATCH to WinSock in setsockopt\n- Silently return on WSAENOTSOCK from WinSock for AFD handles\n- Move timeout comment above var declarations\n- Add explanation for alignment-safe @memcpy of timeval\n- Add comment re: poll failure vs no-data in client read
- src/proto.zig: add FileDescriptorNotASocket to FillError so posix.read
can propagate it when reading from a closed socket on Windows
- src/windows.zig: map WSAENOTSOCK to FileDescriptorNotASocket (was
unreachable) and add it to RecvError/SendError
- src/client/client.zig: map all io.vtable.netRead errors to ReadFailed
to keep inferred error set compatible with callers
Addresses review: a prior read can decrypt more than the caller consumed, leaving
plaintext in the TLS client's buffer while the socket is empty, so polling the fd
would spuriously time out and starve buffered data. Check reader.bufferedLen()
first. A poll failure is surfaced as a read failure (mapped into the fill error
set) rather than swallowed.
The TLS read path goes through std.crypto.tls, whose reader treats a socket
EAGAIN (produced by SO_RCVTIMEO on timeout) as a programmer bug and panics in
debug builds. Poll the fd for readiness instead, so a read timeout surfaces as
error.WouldBlock without ever issuing a read that can EAGAIN.
zig17: fix changes in builtin and std.meta
use @splat() in place of already removed ** operator
Using std.io instead of std.crypto when creating random
Using `std.io` For ensuring zig 0.16 standard
Annotate return type of Handler.close() method
fix: replace ambiguous '{}' with '{f}' in log.info for std.net.Address
server: Wait for threads to exit when stopping
This can happen if the client is disconneted just before the server is shutdown.
https://github.com/karlseguin/websocket.zig/issues/80
Fix client regression: Calling client.close() on a TLS connection while readLoop is running results in a crash
Fix: Client: only send message frames compressed
Implement client compression
Make testing.ensureMessage public.
https://github.com/karlseguin/websocket.zig/issues/71
Make testing.ensureMessage public.
https://github.com/karlseguin/websocket.zig/issues/71
Allow port to be specified.
https://github.com/karlseguin/websocket.zig/issues/71
```
wt.init(.{.port = 3233});
```
Allow port to be specified.
https://github.com/karlseguin/websocket.zig/issues/71
```
wt.init(.{.port = 3233});
```
https://github.com/karlseguin/websocket.zig/issues/64
fix proto Reader init in testing helper
fix client.close() usage in readme
default to no compression, since the testing helper is focused on
message handling at the application level.
fix conn.writeBuffer() usage in readme
- Remove WSAPoll/WSAPOLLFD/POLL from ws2_32.zig (unused since std.posix.poll)\n- Fall through both NOT_SUPPORTED and OBJECT_TYPE_MISMATCH to WinSock in setsockopt\n- Silently return on WSAENOTSOCK from WinSock for AFD handles\n- Move timeout comment above var declarations\n- Add explanation for alignment-safe @memcpy of timeval\n- Add comment re: poll failure vs no-data in client read
- src/proto.zig: add FileDescriptorNotASocket to FillError so posix.read
can propagate it when reading from a closed socket on Windows
- src/windows.zig: map WSAENOTSOCK to FileDescriptorNotASocket (was
unreachable) and add it to RecvError/SendError
- src/client/client.zig: map all io.vtable.netRead errors to ReadFailed
to keep inferred error set compatible with callers
Addresses review: a prior read can decrypt more than the caller consumed, leaving
plaintext in the TLS client's buffer while the socket is empty, so polling the fd
would spuriously time out and starve buffered data. Check reader.bufferedLen()
first. A poll failure is surfaced as a read failure (mapped into the fill error
set) rather than swallowed.