46 : sfd(-1), is_nonblocking(false), close_on_destructor(true) {}
52 : sfd(other.sfd), is_nonblocking(false), close_on_destructor(true) {
73 if (0 >
sfd)
return 0;
75 if (0 > close(
sfd))
return -1;
102 socklen_t optlen)
const {
103 return setsockopt(
sfd, level, optname, optval, optlen);
Contains libsocket elements.
int set_sock_opt(int level, int optname, const char *optval, socklen_t optlen) const
Set socket options on the underlying socket.
int getfd(void) const
Returns the socket file descriptor.
socket is the base class of every other libsocket++ object.
socket(void)
Constructor. Sets sfd to -1.
int sfd
sfd is the sockets API file descriptor
virtual ~socket()
Destructor: closes socket.
virtual int destroy(void)
Destroys a socket.