--- a/src/Network/Endpoint.hh Fri Jan 16 01:05:34 2009 +0200
+++ b/src/Network/Endpoint.hh Fri Jan 16 21:24:45 2009 +0200
@@ -1,18 +1,14 @@
#ifndef NETWORK_ENDPOINT_HH
#define NETWORK_ENDPOINT_HH
-#include "../Error.hh"
-
-/*
- * Platform-specific includes
+/**
+ * @file
+ *
+ * Textual NetworkEndpoint addresses
*/
-#ifndef WIN32
- // linux
- #include <sys/types.h>
- #include <netdb.h>
-#else
- #error "This network code won't compile on win32 :)"
-#endif
+
+#include "../Error.hh"
+#include "Platform.hh"
#include <string>
@@ -22,12 +18,19 @@
#endif
/**
- * Length of a network address
+ * Length of a network address in text form
*/
const socklen_t NETWORK_ADDRESS_LENGTH = INET6_ADDRSTRLEN;
/**
- * We use ClanLib's IPAddress API, but with our own name
+ * NetworkEndpoint is mostly used to pass addresses from the (human) user to NetworkSocket's bind()/connect(). The
+ * constructor accepts a textual service name (port) and hostname (literal IP adddress or hostname), and can then
+ * provide a list of resolved addresses for use by NetworkSocket (using the libc getaddrinfo). Additionally,
+ * methods/operators are defined for textual output of the address.
+ *
+ * It may be of value to note that the hostname/service is only interpreted by the get_addrinfo() method, which means
+ * that invalid/non-existant hostnames/services will only raise an error once the NetworkEndpoint is passed to
+ * NetworkSocket.
*/
class NetworkEndpoint {
protected:
@@ -98,7 +101,7 @@
std::ostream& operator<< (std::ostream &s, const NetworkEndpoint &addr);
/**
- *
+ * Errors raised by NetworkEndpoint, so e.g. DNS errors (hostname not found etc.)
*/
class NetworkAddressError : public Error {
protected: