monotone

monotone Mtn Source Tree

Root/unix/ssh_agent_platform.hh

1// Copyright (C) 2007 Justin Patrin <papercrane@reversefold.com>
2//
3// This program is made available under the GNU GPL version 2.0 or
4// greater. See the accompanying file COPYING for details.
5//
6// This program is distributed WITHOUT ANY WARRANTY; without even the
7// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8// PURPOSE.
9
10#include "../numeric_vocab.hh"
11#include "../netxx/stream.h"
12
13class ssh_agent_platform {
14private:
15 Netxx::Stream stream;
16 Netxx::socket_type connect();
17
18public:
19 // We rely on Netxx::Stream not blowing up if constructed from an
20 // invalid file descriptor, as long as no one actually tries to write()
21 // or read() on it.
22 ssh_agent_platform() : stream(connect()) {}
23 bool connected() { return stream.get_socketfd() != -1; }
24
25 void write_data(std::string const & data);
26 void read_data(u32 const len, std::string & out);
27};

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status