eve.net.ssh.driver
Fair EVE session driver for ddn-net-ssh.
EveSessionDriver schedules a single non-reentrant session pump on an EVE event loop. Connect/readiness events, agent progress, and application callbacks all funnel into one coalesced pump pass with bounded work; repeated readiness while a pass is running requests exactly one follow-up pass, while transport waits never poll.
Applications observe progress through channel watchers rather than periodic polling: a watcher runs when its channel actually makes progress (readable data, extended data, or send-window relief), and wakeups rotate fairly across channels. The driver knows nothing about SFTP or any other consumer - a watcher is an opaque delegate.
Deadlines cover keepalive/rekey schedules, credential waits, and operation timeouts: one-shot and periodic timers run their callback and then request a pump, so timer-only progress works without any network readiness. shutdown cancels every deadline, closes the transport, wakes all watchers one final time, and turns further pump requests into no-ops.
Types 2
One watched channel and its wakeup delegate.
EVE-driven scheduler for one SSH session.
The driver owns the transport wiring: it installs the connection's onConnect, onData, onWritable, and onClose callbacks and must not be combined with application-installed callbacks on the same connection. The session and transport are borrowed and must outlive the driver.
maxPassesPerWakeupMaximum pump passes per wakeup before deferring continuationprivate EventLoop * loop_private TcpConnection conn_private EveSshTransport transport_private SshSessionImpl session_private bool pumping_private bool pumpRequested_private bool shutdown_private ChannelWatcher[] watchers_private size_t nextWatcher_private Token[] deadlines_private void delegate() onPump_private Token sessionDeadline_private bool sessionDeadlineArmed_private SshChannelOpenOperation[] openWatchers_private void delegate(SshChannelOpenOperation)[] openCallbacks_void requestPump()Requests a coalesced session pump.void watchOpen(SshChannelOpenOperation open,
void delegate(SshChannelOpenOperation) onComplete)Watches an in-flight channel open for terminal completion.void unwatchOpen(SshChannelOpenOperation open)Stops observing an in-flight channel open.void onPump(void delegate() onPump) @propertySets an application hook invoked once after every pump pass.void watchChannel(SshChannel channel, void delegate() onProgress)Watches a channel for actual progress.void unwatchChannel(SshChannel channel)Stops watching a channel.Token registerDeadline(Duration delay, void delegate() onDeadline)Registers a one-shot deadline.void forgetDeadline(Token token)long timerDelayMillis(Duration remaining) static pure nothrowConverts a deadline duration to the event loop's millisecond unit.Token registerPeriodic(Duration interval, void delegate() onTick)Registers a periodic tick (keepalive or rekey schedules).void cancelDeadline(Token token)Cancels a deadline or periodic tick.void shutdown()Shuts the driver down deterministically.void wakeDirtyChannels()this(ref EventLoop loop, ref TcpConnection conn,
EveSshTransport transport, SshSessionImpl session)Constructs a driver and wires the connection callbacks.Functions 6
auto safeConnectCb(void delegate(ref TcpConnection) @system dg) pure nothrow @trustedCasts a system connect callback to the safe EVE callback type.auto safeDataCb(void delegate(ref TcpConnection, scope const(ubyte)[]) @system dg) pure nothrow @trustedCasts a system data callback to the safe EVE callback type.auto safeWritableCb(void delegate(ref TcpConnection) @system dg) pure nothrow @trustedCasts a system writable callback to the safe EVE callback type.auto safeCloseCb(void delegate(ref TcpConnection, SocketCloseReason) @system dg) pure nothrow @trustedCasts a system close callback to the safe EVE callback type.auto safeTimerCb(void delegate(ref EventLoop, Token) @system dg) pure nothrow @trustedCasts a system timer callback to the safe nothrow EVE callback type.auto safeDeferCb(void delegate() @system dg) pure nothrow @trustedCasts a system defer callback to the safe EVE callback type.