* @addtogroup libsocketplusplus * @{ */ * @brief socket is the base class of every other libsocket++ object. * * It provides the most important field: The sfd field holds the file descriptor * for every socket. */
| 69 | * for every socket. |
| 70 | */ |
| 71 | class socket { |
| 72 | protected: |
| 73 | /// sfd is the sockets API file descriptor |
| 74 | int sfd; |
| 75 | bool is_nonblocking; |
| 76 | /// Default is true; if set to false, the file descriptor is not closed when |
| 77 | /// the destructor is called. |
| 78 | bool close_on_destructor; |
| 79 | |
| 80 | public: |
| 81 | socket(void); |
| 82 | socket(const socket&) = delete; |
| 83 | socket(socket&&); |
| 84 | |
| 85 | virtual ~socket(); |
| 86 | |
| 87 | virtual int destroy(void); |
| 88 | |
| 89 | int getfd(void) const; |
| 90 | |
| 91 | int set_sock_opt(int level, int optname, const char* optval, |
| 92 | socklen_t optlen) const; |
| 93 | }; |
| 94 | /** |
| 95 | * @} |
| 96 | */ |
no outgoing calls
no test coverage detected