45 explicit operator
bool() const noexcept {
return native_ !=
nullptr; }
53 std::recursive_mutex&
session_mutex() const noexcept {
return core_->mutex(); }
57 bool is_open() const noexcept {
return open_; }
61 Result<void> try_change_pty_size(PtySize);
62 Result<void> try_request_shell();
63 Result<void> try_request_exec(std::string_view command);
64 Result<void> try_request_subsystem(std::string_view name);
65 Result<void> try_request_env(std::string_view name, std::string_view value);
66 Result<void> try_send_signal(Signal);
69 Result<std::size_t> try_read_some(MutableByteView buf, Stream = Stream::stdout_);
70 Result<std::size_t> try_read_some(MutableByteView buf, Stream, std::chrono::milliseconds timeout);
71 Result<std::string> try_read_all(Stream = Stream::stdout_, std::size_t limit = 64u << 20);
73 Result<std::size_t> try_write_some(ByteView data);
74 Result<std::size_t> try_write_some(ByteView data, Stream stream);
75 Result<void> try_write_all(ByteView data);
76 Result<void> try_write_all(ByteView data, Stream stream);
77 Result<void> try_write_all(std::string_view data);
78 Result<void> try_write_all(std::string_view data, Stream stream);
80 Result<std::size_t> try_bytes_available(Stream = Stream::stdout_)
const;
81 Result<bool> try_wait_readable(std::chrono::milliseconds, Stream = Stream::stdout_);
84 Result<void> try_send_eof();
85 bool is_eof() const noexcept;
86 Result<
void> try_close();
87 bool is_closed() const noexcept {
return !open_; }
90 Result<ExitState> try_wait_exit(std::chrono::milliseconds timeout = std::chrono::milliseconds::max());
98#if SSHPP_WITH_FORWARDING
101 std::string_view origin_host, std::uint16_t origin_port);
103 std::string_view origin_host, std::uint16_t origin_port);
108 : native_(n), core_(
std::move(core)), owning_(
owning) {}
111#if SSHPP_WITH_FORWARDING