Class: Microsandbox::SshServer
- Inherits:
-
Object
- Object
- Microsandbox::SshServer
- Defined in:
- lib/microsandbox/ssh.rb
Overview
A reusable SSH server endpoint for a sandbox, from Microsandbox::SshOps#prepare_server. Each #serve_connection serves a single SSH transport over this process’s stdin/stdout — typically wired up by a parent SSH daemon via ‘ForceCommand` or an inetd-style spawn. Mirrors the `SshServer` of the official SDKs.
Instance Method Summary collapse
-
#close ⇒ nil
Release the prepared server endpoint.
-
#initialize(native) ⇒ SshServer
constructor
A new instance of SshServer.
-
#serve_connection ⇒ nil
Serve one SSH connection over this process’s stdin/stdout.
Constructor Details
#initialize(native) ⇒ SshServer
Returns a new instance of SshServer.
186 187 188 |
# File 'lib/microsandbox/ssh.rb', line 186 def initialize(native) @native = native end |
Instance Method Details
#close ⇒ nil
Release the prepared server endpoint. Idempotent.
200 201 202 203 |
# File 'lib/microsandbox/ssh.rb', line 200 def close @native.close nil end |
#serve_connection ⇒ nil
Serve one SSH connection over this process’s stdin/stdout. Blocks until the session ends.
193 194 195 196 |
# File 'lib/microsandbox/ssh.rb', line 193 def serve_connection @native.serve_connection nil end |