eve.net.ssh.transport
EVE TCP transport adapter for ddn-net-ssh.
Wraps an EVE connection (TcpConnection or UnixConnection) into the SshTransport contract from ddn.api.net.ssh. Incoming data from EVE's onData callback is buffered internally and presented through the synchronous EveStreamTransport.read method; outbound data written through EveStreamTransport.write is copied into EVE's send queue.
The module exports two aliases of the same implementation: EveSshTransport for SSH TCP sessions and EveAgentTransport for ssh-agent Unix sockets.
Typical usage:
auto conn = TcpConnection.create();
auto transport = new EveSshTransport(conn);
conn.onData = (ref TcpConnection c, scope const(ubyte)[] data) {
transport.feed(data);
session.pump();
};
conn.onClose = (ref TcpConnection c, SocketCloseReason reason) {
transport.noteClosed(reason);
session.pump();
};Required EVE APIs. This adapter requires an EVE release providing: TcpConnection with create, connect, send returning SendStatus with the queue-based contract (OK and PARTIAL accept the whole buffer, PRESSURE accepts nothing), close, isOpen, pauseReading, resumeReading, and the onConnect, onData, onWritable, onClose callback properties; SocketCloseReason; and EventLoop with create, run, stop, dispose, and registerTimer.
Ownership. The application owns both the connection and the transport and must keep the connection alive for the transport's lifetime. The adapter does not install EVE callbacks itself: the application wires onData to feed and onClose to noteClosed. close closes the underlying connection.
Acceptance is not acknowledgment. write reporting accepted bytes means EVE queued them for transmission; the peer has not acknowledged anything. Higher-level semantics (for example SFTP write confirmations) stay with the protocol layers.
This module depends on EVE and the shared SSH API contracts only. The dependency direction is one-way: ddn-net-ssh and the SFTP package never import EVE.
Types 4
Receive-side bounds of EveSshTransport.
The result of a peer close event as translated for read.
EVE-backed byte-stream transport adapting one connection type C.
Incoming bytes are fed through feed and drained through read; the internal receive buffer is bounded by pausing socket reads at the high-water mark and resuming below the low-water mark. The buffer may exceed the high-water mark by at most one already-delivered chunk.
private C conn_private ubyte[] readBuffer_private size_t readPos_private size_t receiveHighWater_private size_t receiveLowWater_private bool readPaused_private TransportCloseState closeState_ptrdiff_t write(const(ubyte)[] data) @trustedQueues data for transmission on the underlying connection.void flush() @safe pure nothrowFlushes buffered output. No-op: EVE queues and flushes writes itself.bool readPaused() @property const @safe nothrow @nogcReturns: whether socket read delivery is currently paused at the receive high-water mark.size_t bufferedBytes() @property const @safe nothrow @nogcReturns: the number of buffered bytes not yet read.this(ref C conn,
size_t receiveHighWater =
EveSshTransportLimits.receiveHighWater,
size_t receiveLowWater =
EveSshTransportLimits.receiveLowWater)Constructs the adapter over an EVE TCP connection.SSH TCP transport adapter over an EVE TcpConnection.