# std.Io.net.HostName: move lookup to the interface · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/35ce907c06d5758adab276927ad8dbe730d6130d)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 35ce907c06d5758adab276927ad8dbe730d6130d

Requested commit: 35ce907c06d5758adab276927ad8dbe730d6130d

Commit: 35ce907c06d5758adab276927ad8dbe730d6130d

Tree: c7d3839b953c4c0a7e5beee7090713d28fff04b3

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
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.

```

## Parents

- [1382e4122603fd2b57e4feb0eff76ba2d73a913a](https://git.cafe/gitcafe/zig/commit/1382e4122603fd2b57e4feb0eff76ba2d73a913a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/35ce907c06d5758adab276927ad8dbe730d6130d?format=markdown)
