diff options
| author | Kris Alder <kalder@google.com> | 2022-04-08 14:06:21 -0700 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-04-12 19:32:41 +0200 |
| commit | 87d46b64e1389c842869fae9199221565d6f65d2 (patch) | |
| tree | 8030113f01a1db5af4ec3181dd003358f0a7436e /pkg/instance | |
| parent | dacb3f1c44e9c527b8bb595e3b37a43ca7733cc0 (diff) | |
vm/cuttlefish: implement forward function
We need to tunnel ports from the Manager instance all the way through to the virtual device. We do
this by tunneling from the Manager to the worker GCE instance using 'socat' on the worker instance
and 'adb reverse' to forward the port on the device.
We need the 'socat' process to keep running for the tunnel to stay open. We can check for an error
on launch, but to check if the process is still running we send it a zero signal after waiting an
appropriate amount of time.
The 'adb reverse' command, by comparison returns immediately after the connection is established and
keeps the tunnel open. We loop until we find a valid/available port, similar to what is done in
vm/adb/adb.go. In practice, this nearly always finds a valid port on the first attempt.
Diffstat (limited to 'pkg/instance')
0 files changed, 0 insertions, 0 deletions
