diff --git a/libscio.hpp b/libscio.hpp index 1fb14f3..fb71311 100644 --- a/libscio.hpp +++ b/libscio.hpp @@ -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; @@ -117,6 +117,14 @@ namespace sc { void endpoint_from_address(const socket_address& address, 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};