X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Fsocket.h;h=7a47793eab9515f9871446c03c5cc612753c6fa7;hb=ede42d5bb352841e2e425972e12b8ef31ddf2123;hp=c675ab5801766635e93fbb8a6bbead4497820635;hpb=3ab65d35cfd696002e09768a38f98e6a2e1ade81;p=libs%2Fnet.git diff --git a/source/net/socket.h b/source/net/socket.h index c675ab5..7a47793 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 @@ -30,8 +31,8 @@ protected: struct Private; - Private *priv = nullptr; - SockAddr *local_addr = nullptr; + std::unique_ptr priv; + std::unique_ptr local_addr; Socket(const Private &); Socket(Family, int, int); @@ -43,14 +44,14 @@ public: void set_block(bool) override; void set_inherit(bool) override; - const IO::Handle &get_handle(IO::Mode); + 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. */ void bind(const SockAddr &); - bool is_bound() const { return local_addr; } + bool is_bound() const { return static_cast(local_addr); } const SockAddr &get_local_address() const; void set_timeout(const Time::TimeDelta &);