+++ /dev/null
-#include "platform_api.h"
-#include "constants.h"
-#include <stdexcept>
-
-using namespace std;
-
-namespace Msp {
-namespace Net {
-
-int family_to_sys(Family f)
-{
- switch(f)
- {
- case UNSPEC: return AF_UNSPEC;
- case INET: return AF_INET;
- case INET6: return AF_INET6;
- case UNIX: return AF_UNIX;
- default: throw invalid_argument("family_to_sys");
- }
-}
-
-Family family_from_sys(int f)
-{
- switch(f)
- {
- case AF_UNSPEC: return UNSPEC;
- case AF_INET: return INET;
- case AF_INET6: return INET6;
- case AF_UNIX: return UNIX;
- default: throw invalid_argument("family_from_sys");
- }
-}
-
-} // namespace Net
-} // namespace Msp
#ifndef MSP_NET_CONSTANTS_H_
#define MSP_NET_CONSTANTS_H_
-namespace Msp {
-namespace Net {
+#warning "This header is deprected and should not be used"
-enum Family
-{
- UNSPEC,
- INET,
- INET6,
- UNIX
-};
-
-int family_to_sys(Family);
-Family family_from_sys(int);
-
-} // namespace Net
-} // namespace Msp
+#include "sockaddr.h"
#endif
#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
addr.ss_family = AF_UNSPEC;
}
+
+int family_to_sys(Family f)
+{
+ switch(f)
+ {
+ case UNSPEC: return AF_UNSPEC;
+ case INET: return AF_INET;
+ case INET6: return AF_INET6;
+ case UNIX: return AF_UNIX;
+ default: throw invalid_argument("family_to_sys");
+ }
+}
+
+Family family_from_sys(int f)
+{
+ switch(f)
+ {
+ case AF_UNSPEC: return UNSPEC;
+ case AF_INET: return INET;
+ case AF_INET6: return INET6;
+ case AF_UNIX: return UNIX;
+ default: throw invalid_argument("family_from_sys");
+ }
+}
+
} // namespace Net
} // namespace Msp
#define MSP_NET_SOCKADDR_H_
#include <string>
-#include "constants.h"
namespace Msp {
namespace Net {
+enum Family
+{
+ UNSPEC,
+ INET,
+ INET6,
+ UNIX
+};
+
+
class SockAddr
{
public:
SysAddr();
};
+
+int family_to_sys(Family);
+Family family_from_sys(int);
+
} // namespace Net
} // namespace Msp
#include <msp/core/except.h>
#include <msp/io/eventobject.h>
#include <msp/io/handle.h>
-#include "constants.h"
#include "sockaddr.h"
namespace Msp {