]> git.tdb.fi Git - libs/net.git/blob - source/net/resolve.h
256455fcb18febb08384fd7e6f50e17d35064310
[libs/net.git] / source / net / resolve.h
1 #ifndef MSP_NET_RESOLVE_H_
2 #define MSP_NET_RESOLVE_H_
3
4 #include <string>
5 #include "constants.h"
6
7 namespace Msp {
8 namespace Net {
9
10 class SockAddr;
11
12 /** Resolves host and service names into a socket address.  If host is empty,
13 the loopback address will be used.  If host is "*", the wildcard address will
14 be used.  If service is empty, a socket address with a null service will be
15 returned.  With the IP families, these are not very useful. */
16 SockAddr *resolve(const std::string &, const std::string &, Family = UNSPEC);
17
18 /** And overload of resolve() that takes host and service as a single string,
19 separated by a colon.  If the host part contains colons, such as is the case
20 with a numeric IPv6 address, it must be enclosed in brackets. */
21 SockAddr *resolve(const std::string &, Family = UNSPEC);
22
23 } // namespace Net
24 } // namespace Msp
25
26 #endif