# tcpConnectToHost try all addresses in AddressList · gitcafe/zig

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

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

Visibility: public

Requested revision: a6d1ef64d753f8be59d68695f927e03777bb6514

Requested commit: a6d1ef64d753f8be59d68695f927e03777bb6514

Commit: a6d1ef64d753f8be59d68695f927e03777bb6514

Tree: 2e88fe63dc386fab3afe04773c9d520a57ac6196

Author: Ian Simonson

Committer: Ian Simonson

## Message

```
tcpConnectToHost try all addresses in AddressList

The AddressList returned can contain more than one item
e.g. the ipv4 and ipv6 addresses for a given hostname.
Previously if a server had multiple addresses but
was not listening on one of them Zig would give up
immediately.

Now on std.os.ConnectError.ConnectionRefused Zig will
try the next address in the list. Zig still gives up on
all other errors as they are related to the system and
system resources rather than whether the remote server
is listening on a particular address.

```

## Parents

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

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