pub struct AdapterSocket {
pub workspace: PathBuf,
pub role: String,
pub cluster: String,
pub server: String,
pub dispatch: DispatchState,
}Fields§
§workspace: PathBuf§role: String§cluster: String§server: String§dispatch: DispatchStateImplementations§
Source§impl AdapterSocket
impl AdapterSocket
Sourcepub fn path(&self) -> PathBuf
pub fn path(&self) -> PathBuf
The path this role’s clients connect to, per
RoleWorkspace::socket_path.
One accessor answers for the whole tree, so the daemon that bound
<runtime>/<digest>.sock and a caller that derived it from the
workspace root reach the same socket.
Sourcepub fn registration(&self) -> RegistrationFile
pub fn registration(&self) -> RegistrationFile
The registration this client publishes beside its socket.
The kind is the client’s own: a role workspace’s daemon serves the
client surface, and no reader infers that from what happens to sit
beside the tree. role names the one role this process serves,
runtime the session backend that hosts it, and placement where this
machine displays that runtime — the machine-owned half of the pair an
external runtime’s plugin matches on to find the clients it serves.
Sourcepub async fn bind(&self) -> Result<(LocalListener, SocketEndpoint)>
pub async fn bind(&self) -> Result<(LocalListener, SocketEndpoint)>
Bind the workspace socket and report the endpoint that was served.
bind_socket_v2 owns the whole sequence — resolve the runtime
directory, drop a stale name, and bind <runtime>/<digest>.sock — and
its failure message names the path it tried. The registration is
published after the bind succeeds, so a surface that never opened never
names itself.
The socket is served off the canonical <run_dir>/s spelling, so the log
line names that spelling too: it is what an operator reading the tree
will look for and not find.
Sourcepub async fn accept_loop(&self, listener: LocalListener) -> Result<()>
pub async fn accept_loop(&self, listener: LocalListener) -> Result<()>
Answer every connection on listener for the life of the process.
The listener stays open across a failed accept: one bad handshake on one
socket is that client’s problem, and every plugin already mounted would
lose its transport if the surface came down for it. The pause keeps a
persistent failure — a descriptor ceiling, a name pulled out from under
the listener — from spinning the loop at full speed.
The registration published by bind belongs to this scope:
it names this process as the client for the workspace, and the guard here
takes the file with it when the surface stops serving, however it stops.