#define MSP_NET_RESOLVE_H_
#include <deque>
+#include <memory>
#include <string>
#include <msp/core/mutex.h>
#include <msp/core/semaphore.h>
#include <msp/core/thread.h>
#include <msp/io/eventdispatcher.h>
#include <msp/io/pipe.h>
-#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
std::string host;
std::string serv;
Family family = UNSPEC;
- SockAddr *addr = nullptr;
- std::runtime_error *error = nullptr;
+ std::unique_ptr<SockAddr> addr;
+ std::unique_ptr<std::runtime_error> error;
bool is_complete() const { return addr || error; }
};
WorkerThread();
~WorkerThread();
- void add_task(const Task &);
+ void add_task(Task &&);
Task *get_complete_task();
void pop_complete_task();