forked from favalex/modbus-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use `urllib.parse.urlsplit` to parse hostname + port, defaulting to `localhost:502`. Use `socket.getaddrinfo` to determine the suitable address family, an then attempt to connect for every returned addrinfo. This implementation is compatible with previous behavior for IPv4 hosts, but it enables connecting to IPv6 hosts as well. Examples of device arguments that were previously supported and are still supported: - `localhost` - `localhost:502` - `example.com` - `example:502` - `192.0.2.1` - `192.0.2.1:502` Examples of device arguments that are newly supported: - `"[2001:db8::1]"` - `"[2001:db8::1]:502"` - `"[fe80::1%eth0]"` - `"[fe80::1%eth0]:502"` In addition, IPv6-only hosts with hostnames that could only be resolved via IPv6 are now also supported.
- Loading branch information
Showing
2 changed files
with
59 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters