Andrew Kelley
e49fb4cf31
update all occurrences of close() to close(io)
2025-12-05 19:08:37 -08:00
Alex Rønne Petersen
5078acf3a3
std.Io.net: disable listen on a unix socket, send bytes, receive bytes on Windows
...
https://github.com/ziglang/zig/issues/25983
2025-11-19 21:51:57 +01:00
0x4a61636f62
2e6f7d36b9
std.Io.net: fix off-by-one in HostName.expand
...
`HostName.expand` was including the null terminator in the slice passed to `HostName.init`, which caused `HostName.validate` to fail.
2025-11-13 21:04:21 -08:00
Andrew Kelley
03fd132b1c
std.Io: fix Group.wait unsoundness
...
Previously if a Group.wait was canceled, then a subsequent call to
wait() or cancel() would trip an assertion in the synchronization code.
2025-10-29 06:20:52 -07:00
Andrew Kelley
441d0c4272
std.Io.net.HostName: fix missing group cancel
2025-10-29 06:20:51 -07:00
Andrew Kelley
f9de83c90e
std.Io.net: skip testing netInterfaceNameResolve on Windows
...
let's handle this in a follow-up change. implementation needs to use
ConvertInterfaceNameToLuidW and the additional dependency on
Iphlpapi.dll poses some challenges.
2025-10-29 06:20:51 -07:00
Andrew Kelley
d257b1337a
std.Io.Threaded: fix compilation failures on Windows
2025-10-29 06:20:50 -07:00
Andrew Kelley
10b1eef2d3
std: fix compilation errors on Windows
2025-10-29 06:20:50 -07:00
Andrew Kelley
b215f8667a
std.Io.net.HostName.ResolvConf: ignore nameservers above max
2025-10-29 06:20:50 -07:00
Andrew Kelley
f14c4c3db8
std.Io.net.HostName: fix connectMany not running DNS async
2025-10-29 06:20:50 -07:00
Andrew Kelley
f7bbcb4a4b
fix miscellaneous compilation failures
2025-10-29 06:20:50 -07:00
Andrew Kelley
90fdd21df6
std: move DNS record enum to a better namespace
2025-10-29 06:20:50 -07:00
Andrew Kelley
060fd975d9
std.Io.Group: add cancellation support to "wait"
2025-10-29 06:20:49 -07:00
Andrew Kelley
870a682cd8
std.Io.net.HostName.connect: fix resource leaks
...
Must free other succeeded connections that lost the race.
2025-10-29 06:20:49 -07:00
Andrew Kelley
adaef433d2
std.net.HostName.connect: rework to avoid waiting for DNS
...
The previous implementation would eagerly attempt TCP connection upon
receiving a DNS reply, but it would still wait for all the DNS results
before returning from the function.
This implementation returns immediately upon first successful TCP
connection, canceling not only in-flight TCP connection attempts but
also unfinished DNS queries.
2025-10-29 06:20:49 -07:00
Andrew Kelley
d3c4158a10
std.Io: implement Select
...
and finish implementation of HostName.connect
2025-10-29 06:20:49 -07:00
Andrew Kelley
35ce907c06
std.Io.net.HostName: move lookup to the interface
...
Unfortunately this can't be implemented "above the vtable" because
various operating systems don't provide low level DNS resolution
primitives such as just putting the list of nameservers in a file.
Without libc on Linux it works great though!
Anyway this also changes the API to be based on Io.Queue. By using a
large enough buffer, reusable code can be written that does not require
concurrent, yet takes advantage of responding to DNS queries as they
come in. I sketched out a new implementation of `HostName.connect` to
demonstrate this, but it will require an additional API (`Io.Select`) to
be implemented in a future commit.
This commit also introduces "uncancelable" variants for mutex locking,
waiting on a condition, and putting items into a queue.
2025-10-29 06:20:49 -07:00
Andrew Kelley
e8cea8accb
std.Io.Threaded: implement netListenUnix
2025-10-29 06:20:49 -07:00
Andrew Kelley
539808239e
std.net: IPv6 parsing fixes
2025-10-29 06:20:49 -07:00
Andrew Kelley
d3f0c460ec
std.Io.net.HostName: fix DNS resolution
...
* merge conflict with changing behavior of takeDelimiterExclusive
* check bounds before adding to result array
2025-10-29 06:20:49 -07:00
Andrew Kelley
923a7bdd7e
std.Io.net: fix parsing IPv4-mapped IPv6 addresses
2025-10-29 06:20:49 -07:00
Andrew Kelley
3b34622368
std.Io: add unix domain sockets API
...
note that "reuseaddr" does nothing for these
2025-10-29 06:20:49 -07:00
Andrew Kelley
ebcc6f166c
std.Io: bring back Timestamp but also keep Clock.Timestamp
...
this feels better
2025-10-29 06:20:49 -07:00
Andrew Kelley
47aa5a70a5
std: updating to std.Io interface
...
got the build runner compiling
2025-10-29 06:20:48 -07:00
Andrew Kelley
b428612a20
WIP: hack away at std.Io return flight
2025-10-29 06:20:48 -07:00
Andrew Kelley
774df26835
WIP: hack at std.Io on a plane
2025-10-29 06:20:48 -07:00
Andrew Kelley
00f26cb0a4
WIP land the std.Io interface
...
fix std lib compilation errors caused by introducing std.Io
2025-10-29 06:20:48 -07:00
Andrew Kelley
85a6fea3be
std.Io.net.HostName: implement DNS name expansion
2025-10-29 06:20:48 -07:00
Andrew Kelley
f1a590c876
std.Io.net.HostName: implement DNS reply parsing
2025-10-29 06:20:48 -07:00
Andrew Kelley
a6347a68a9
std.Io.net: implement receiving connectionless messages
2025-10-29 06:20:48 -07:00
Andrew Kelley
95dee2af9c
std.Io: implement netSend
2025-10-29 06:20:48 -07:00
Andrew Kelley
cde5a51d0c
std.Io.net: make netSend support multiple messages
...
this lowers to sendmmsg on linux, and means Io.Group is no longer
needed, resulting in a more efficient implementation.
2025-10-29 06:20:48 -07:00
Andrew Kelley
b22400271f
std.Io.net.HostName: finish implementing DNS lookup
2025-10-29 06:20:48 -07:00
Andrew Kelley
8e1da66ba1
std.Io: implement Group API
2025-10-29 06:20:48 -07:00
Andrew Kelley
60c4bdb14c
Io.net: implement more networking
...
the next task is now implementing Io.Group
2025-10-29 06:20:48 -07:00
Andrew Kelley
8771a9f082
std.Io.net: progress towards DNS resolution
2025-10-29 06:20:48 -07:00
Andrew Kelley
885b3f8342
Io.net: finish implementing IPv6 parsing
2025-10-29 06:20:48 -07:00
Andrew Kelley
e7c9df9fb0
Io.net: use resolve for IPv6
...
/etc/resolv.conf might have IPv6 addresses with scope in it, so this is
needed.
2025-10-29 06:20:48 -07:00
Andrew Kelley
d776a6bbbe
Io.net: rework IPv6 parsing and printing
...
extract pure functional logic into pure functions and then layer the
scope crap on top properly
the formatting code incorrectly didn't do the reverse operation
(if_indextoname). fix that with some TODO panics
2025-10-29 06:20:48 -07:00
Andrew Kelley
0e9280ef1a
std.Io: extract Dir to separate file
2025-10-29 06:20:48 -07:00
Andrew Kelley
fc1e3d5bc9
Io.net: partial implementation of dns lookup
2025-10-29 06:20:48 -07:00