class Socket { public: explicit Socket(int fd) : fd_(fd) {} ~Socket() { close_socket(fd_); } int get() const { return fd_; } private: int fd_; }; void send_probe(Socket socket) { send_bytes(socket.get(), "ping"); }