libsshpp v0.1.7
Modern C++17 wrapper for libssh
Loading...
Searching...
No Matches
sshpp::BidirectionalPump Class Reference

#include <forwarding.hpp>

Public Member Functions

 BidirectionalPump (Channel &, int local_fd, std::size_t buffer_size=64 *1024)
 
 ~BidirectionalPump ()
 
 BidirectionalPump (const BidirectionalPump &)=delete
 
BidirectionalPumpoperator= (const BidirectionalPump &)=delete
 
Result< void > try_run_until_stopped ()
 Drives the pump on the calling thread until both directions reach EOF/close.
 
void stop () noexcept
 
bool finished () const noexcept
 
std::pair< std::uint64_t, std::uint64_t > byte_counts () const noexcept
 

Detailed Description

Pairs two byte pumps (fd->channel and channel->fd) with lifetime/EOF handling. Uses the same poll-based pump as LocalForward/RemoteForward so byte_counts() and finished() are always accurate (see the scope note at the top of this file). Deliberately takes no Session& (unlike the design doc's sketch): nothing it does needs one, and callers that only have a Channel (e.g. X11Forwarder) would not be able to supply one.

Constructor & Destructor Documentation

◆ BidirectionalPump() [1/2]

SSHPP_INLINE sshpp::BidirectionalPump::BidirectionalPump ( Channel channel,
int  local_fd,
std::size_t  buffer_size = 64 * 1024 
)

◆ ~BidirectionalPump()

SSHPP_INLINE sshpp::BidirectionalPump::~BidirectionalPump ( )

◆ BidirectionalPump() [2/2]

sshpp::BidirectionalPump::BidirectionalPump ( const BidirectionalPump )
delete

Member Function Documentation

◆ operator=()

BidirectionalPump & sshpp::BidirectionalPump::operator= ( const BidirectionalPump )
delete

◆ try_run_until_stopped()

SSHPP_INLINE Result< void > sshpp::BidirectionalPump::try_run_until_stopped ( )

Drives the pump on the calling thread until both directions reach EOF/close.

◆ stop()

SSHPP_INLINE void sshpp::BidirectionalPump::stop ( )
noexcept

◆ finished()

bool sshpp::BidirectionalPump::finished ( ) const
inlinenoexcept

◆ byte_counts()

SSHPP_INLINE std::pair< std::uint64_t, std::uint64_t > sshpp::BidirectionalPump::byte_counts ( ) const
noexcept

The documentation for this class was generated from the following files: