So ideally:
actual backend with ephemeral ports.
The backend is the one who instructs the tcp task to start receiving.
The backend owns the buffers and communications
When the stream is stopped, the backend cleans up the tcp task
when the tcp task is dropped, the backend notifies the frontend
When the pane is closed, the backend cleans up both the TCP (if active) and the data task.
backend accepts connections on 8080 and promotes them to open ephemeral immediately
the ephemeral task is not ingesting anything unless the UI instructs it to (by clicking connect)
So ideally:
actual backend with ephemeral ports.
The backend is the one who instructs the tcp task to start receiving.
The backend owns the buffers and communications
When the stream is stopped, the backend cleans up the tcp task
when the tcp task is dropped, the backend notifies the frontend
When the pane is closed, the backend cleans up both the TCP (if active) and the data task.
backend accepts connections on 8080 and promotes them to open ephemeral immediately
the ephemeral task is not ingesting anything unless the UI instructs it to (by clicking connect)