X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fnet%2Fresolve.h;fp=source%2Fnet%2Fresolve.h;h=256455fcb18febb08384fd7e6f50e17d35064310;hb=50e9f9ea7f7385a2c5931fca2b8fb1103078e67c;hp=0000000000000000000000000000000000000000;hpb=21c596567e3b6fd794ed6af73d304ce2bc70e58f;p=libs%2Fnet.git diff --git a/source/net/resolve.h b/source/net/resolve.h new file mode 100644 index 0000000..256455f --- /dev/null +++ b/source/net/resolve.h @@ -0,0 +1,26 @@ +#ifndef MSP_NET_RESOLVE_H_ +#define MSP_NET_RESOLVE_H_ + +#include +#include "constants.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 +returned. With the IP families, these are not very useful. */ +SockAddr *resolve(const std::string &, const std::string &, Family = UNSPEC); + +/** And overload of resolve() that takes host and service as a single string, +separated by a colon. If the host part contains colons, such as is the case +with a numeric IPv6 address, it must be enclosed in brackets. */ +SockAddr *resolve(const std::string &, Family = UNSPEC); + +} // namespace Net +} // namespace Msp + +#endif