Skip to content

Conversation

@papazof
Copy link
Contributor

@papazof papazof commented Jun 24, 2025

Add primitives for TCP support:

  • Add helpers to parse TCP addresses
  • Add TCP transport and helpers for the async implementation

Note:
This PR does not include Windows support for TCP since we don't use or have experience with it, but since the TCP support is based on std::net components the rust primitives should be cross-platform

@lifupan

@papazof papazof force-pushed the feat_add_unix_tcp_support branch from 0724171 to eb1b21c Compare June 24, 2025 18:13
Add TCP support for non-windows platforms:
- Add helpers to parse TCP addresses
- Add TCP transport and helpers for the async implementation

Signed-off-by: Kostis Papazafeiropoulos <[email protected]>
@papazof papazof force-pushed the feat_add_unix_tcp_support branch from eb1b21c to b4331ab Compare June 24, 2025 18:20
@papazof papazof marked this pull request as ready for review June 24, 2025 19:36
@Tim-Zhang Tim-Zhang requested a review from jsturtevant June 25, 2025 08:43
@Tim-Zhang
Copy link
Member

Tim-Zhang commented Jun 26, 2025

Hi @papazof, Thank you for you pull request and how about adding a new example which name is like async-tcp-server and async-tcp-client

With these two files, we can not only know how to use the TCP feature, but also quickly add it to the CI

run_example("async-stream-server", "async-stream-client")?;

Thanks again!

Copy link
Collaborator

@teawater teawater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@papazof
Copy link
Contributor Author

papazof commented Jun 26, 2025

Hi @papazof, Thank you for you pull request and how about adding a new example which name is like async-tcp-server and async-tcp-client

With these two files, we can not only know how to use the TCP feature, but also quickly add it to the CI

run_example("async-stream-server", "async-stream-client")?;

Thanks again!

Sure, i was debating on how to add examples on this. The workflow is the same as the existing examples (apart from the sock removal), so all previous examples should work (on unix) by simply changing the socket. Do you think extending the existing examples - ie. with a cli arg - would make sense for you or do you have another solution in mind?

@Tim-Zhang
Copy link
Member

Hi @papazof, Thank you for you pull request and how about adding a new example which name is like async-tcp-server and async-tcp-client
With these two files, we can not only know how to use the TCP feature, but also quickly add it to the CI

run_example("async-stream-server", "async-stream-client")?;

Thanks again!

Sure, i was debating on how to add examples on this. The workflow is the same as the existing examples (apart from the sock removal), so all previous examples should work (on unix) by simply changing the socket. Do you think extending the existing examples - ie. with a cli arg - would make sense for you or do you have another solution in mind?

Good, let's do it.

Extend examples to use a TCP socket if the `--tcp` flag is provided and
add the TCP versions to `run-examples`

Signed-off-by: Kostis Papazafeiropoulos <[email protected]>
@papazof
Copy link
Contributor Author

papazof commented Jun 27, 2025

I had a go at extending the examples. Let me know if you want something handled differently.

Copy link
Member

@Tim-Zhang Tim-Zhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @papazof

@Tim-Zhang Tim-Zhang merged commit 871dcfb into containerd:master Jul 1, 2025
10 checks passed
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