X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Fresolve.h;h=212a7f0a47574068b1b7573acf973ef76cbbc5ca;hb=63432878fc84bc666bb74efaeee588fa6d03d5b2;hp=6a0479e6aa363f2b22a49b5e1b999860a7666417;hpb=6625cf0e574406425c35d33110f8d99617e902df;p=libs%2Fnet.git diff --git a/source/net/resolve.h b/source/net/resolve.h index 6a0479e..212a7f0 100644 --- a/source/net/resolve.h +++ b/source/net/resolve.h @@ -2,19 +2,18 @@ #define MSP_NET_RESOLVE_H_ #include +#include #include #include #include #include #include #include -#include "constants.h" +#include "sockaddr.h" namespace Msp { namespace Net { -class SockAddr; - /** Resolves host and service names into a socket address. If host is empty, the loopback address will be used. If host is "*", the wildcard address will be used. If service is empty, a socket address with a null service will be @@ -40,8 +39,8 @@ private: std::string host; std::string serv; Family family = UNSPEC; - SockAddr *addr = 0; - std::runtime_error *error = 0; + std::unique_ptr addr; + std::unique_ptr error; bool is_complete() const { return addr || error; } }; @@ -59,7 +58,7 @@ private: WorkerThread(); ~WorkerThread(); - void add_task(const Task &); + void add_task(Task &&); Task *get_complete_task(); void pop_complete_task(); @@ -74,7 +73,7 @@ public: sigc::signal signal_resolve_failed; private: - IO::EventDispatcher *event_disp = 0; + IO::EventDispatcher *event_disp = nullptr; WorkerThread thread; unsigned next_tag = 1;