X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Fsocket.h;h=c55a5390a673d868b51d9e52a9675fee18f79b79;hb=e900bb4a8fe086fac55ffe51c75915be0003c5e4;hp=bca58fad4d98d191b7aed753ac88eff493ca3359;hpb=d2a04687736c6d1613f44d67bdebc04466efdbd2;p=libs%2Fnet.git diff --git a/source/net/socket.h b/source/net/socket.h index bca58fa..c55a539 100644 --- a/source/net/socket.h +++ b/source/net/socket.h @@ -1,6 +1,7 @@ #ifndef MSP_NET_SOCKET_H_ #define MSP_NET_SOCKET_H_ +#include #include #include #include "constants.h" @@ -9,11 +10,10 @@ namespace Msp { namespace Net { -class bad_socket_state: public std::logic_error +class bad_socket_state: public invalid_state { public: - bad_socket_state(const std::string &w): std::logic_error(w) { } - virtual ~bad_socket_state() throw() { } + bad_socket_state(const std::string &w): invalid_state(w) { } }; @@ -30,8 +30,8 @@ protected: struct Private; - Private *priv; - SockAddr *local_addr; + Private *priv = nullptr; + SockAddr *local_addr = nullptr; Socket(const Private &); Socket(Family, int, int); @@ -41,10 +41,10 @@ private: public: ~Socket(); - virtual void set_block(bool); - virtual void set_inherit(bool); - const IO::Handle &get_handle(IO::Mode); - virtual const IO::Handle &get_event_handle(); + void set_block(bool) override; + void set_inherit(bool) override; + const IO::Handle &get_handle(IO::Mode) override; + const IO::Handle &get_event_handle() override; /** Associates the socket with a local address. There must be no existing users of the address. */