VsockConnectionStream: Conform to AsyncSequence (#380)

I didn't like how we expose the asyncstream via a public connections
field. We should have the type conform to AsyncSequence and then hide
the underlying stream. This also stops listening on the stdio ports
after we get the initial connection.
This commit is contained in:
Danny Canter authored and GitHub committed 2025-11-03 14:09:56 -08:00
1 parent 8b39713a00
commit bec1008f4d
3 files changed
+24 -7

No files matched your search

@@ -201,7 +201,7 @@ extension SocketRelay {
$0.t = Task {
do {
defer { connectionStream.finish() }
for await connection in connectionStream.connections {
for await connection in connectionStream {
try await self.handleGuestVsockConn(
vsockConn: connection,
hostConnectionPath: hostPath,