renamed buffer accessors; added accessors for socketstream members

This commit is contained in:
Bob Polis 2020-04-24 16:13:28 +02:00
parent 8d327cb1d2
commit 027f9cb59e

View File

@ -41,8 +41,8 @@ namespace sc {
fdostream(int fd) : std::ostream(&_outbuf), _outbuf(fd) {}
fdostream() : std::ostream(&_outbuf), _outbuf(-1) {}
int fd() const { return _outbuf.fd(); }
void fd(int fd) { _outbuf.fd(fd); }
int ofd() const { return _outbuf.fd(); }
void ofd(int fd) { _outbuf.fd(fd); }
protected:
fdoutbuf _outbuf;
@ -69,8 +69,8 @@ namespace sc {
fdistream(int fd) : std::istream(&_inbuf), _inbuf(fd) {}
fdistream() : std::istream(&_inbuf), _inbuf(-1) {}
int fd() const { return _inbuf.fd(); }
void fd(int fd) { _inbuf.fd(fd); }
int ifd() const { return _inbuf.fd(); }
void ifd(int fd) { _inbuf.fd(fd); }
protected:
fdinbuf _inbuf;
@ -118,6 +118,14 @@ namespace sc {
struct sockaddr_storage* endpoint) const;
socket_address address_from_endpoint(const struct sockaddr* endpoint) const;
// getters & setters
int socket() const { return _socket; }
void socket(int sock);
int domain() const { return _domain; }
void domain(int dom) { _domain = dom; }
int type() const { return _type; }
void type(int typ) { _type = typ; }
protected:
int _socket {-1};
int _domain {0};