removed bluetooth_classic_socket specific stream semantics. all linux sockets should use stream.h. improved stream semantics in stream.h

This commit is contained in:
lasan
2026-06-09 21:38:13 +05:30
parent b4776d9834
commit 18970db598
11 changed files with 232 additions and 426 deletions
@@ -26,26 +26,26 @@ namespace nearby {
namespace linux {
class InputStream : public nearby::InputStream {
public:
explicit InputStream(sdbus::UnixFd fd) : fd_(std::move(fd)){};
explicit InputStream(sdbus::UnixFd fd) : fd_(std::make_shared<sdbus::UnixFd>(fd)){};
ExceptionOr<ByteArray> Read(std::int64_t size) override;
Exception Close() override;
private:
sdbus::UnixFd fd_;
std::shared_ptr<sdbus::UnixFd> fd_;
};
class OutputStream : public nearby::OutputStream {
public:
explicit OutputStream(sdbus::UnixFd fd) : fd_(std::move(fd)){};
explicit OutputStream(sdbus::UnixFd fd) : fd_(std::make_shared<sdbus::UnixFd>(fd)){};
Exception Write(absl::string_view data) override;
Exception Flush() override;
Exception Close() override;
private:
sdbus::UnixFd fd_;
std::shared_ptr<sdbus::UnixFd> fd_;
};
} // namespace linux