Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use VsockAddr instead of cid and port where appropiate #40

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

jalil-salame
Copy link
Contributor

This follows the API of tokio where bind and connect take an addr argument instead of a separate IP/hostname and port.

Tokio actually takes a addr: impl ToSockAddrs because of DNS resolution (ie. localhost can be both 127.0.0.1 and ::1 or any number of IPs for that matter). Vsocks do not do this so it makes sense to keep the argument the same (although we could take addr: impl Into<Vsock> instead in case we add some interesting From and TryFrom methods).

This follows the API of tokio where `bind` and `connect` take an `addr`
argument instead of a separate IP/hostname and port.

Tokio actually takes a `addr: impl ToSockAddrs` because of DNS
resolution (ie. `localhost` can be both `127.0.0.1` and `::1` or any
number of IPs for that matter). Vsocks do not do this so it makes sense
to keep the argument the same (although we could take `addr: impl
Into<Vsock>` instead in case we add some interesting `From` and
`TryFrom` methods).

Signed-off-by: Jalil David Salamé Messina <[email protected]>
@jalil-salame jalil-salame requested a review from a team December 7, 2023 13:36
@jalil-salame jalil-salame merged commit f0aeda6 into master Dec 7, 2023
2 checks passed
@jalil-salame jalil-salame deleted the use-vsockaddr branch December 7, 2023 22:06
qwandor added a commit that referenced this pull request Jan 17, 2024
Bump the major version for API changes in #30 and #40.

Signed-off-by: Andrew Walbran <[email protected]>
@qwandor qwandor mentioned this pull request Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants