]> git.tdb.fi Git - libs/net.git/blobdiff - source/resolve.h
Add an overload for resolve that takes host and service separately
[libs/net.git] / source / resolve.h
index cc957ac46f4b2658d9438a601dcdedb3a260ddbc..256455fcb18febb08384fd7e6f50e17d35064310 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspnet
-Copyright © 2008  Mikkosoft Productions, Mikko Rasa
-Distributed under the LGPL
-*/
-
 #ifndef MSP_NET_RESOLVE_H_
 #define MSP_NET_RESOLVE_H_
 
@@ -16,7 +9,16 @@ namespace Net {
 
 class SockAddr;
 
-SockAddr *resolve(const std::string &, Family =UNSPEC);
+/** 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