]> git.tdb.fi Git - libs/net.git/blob - source/sockaddr.cpp
Fix a comparison operator on win32
[libs/net.git] / source / sockaddr.cpp
1 /* $Id$
2
3 This file is part of libmspnet
4 Copyright © 2008  Mikkosoft Productions, Mikko Rasa
5 Distributed under the LGPL
6 */
7
8 #include <msp/core/except.h>
9 #include "inet.h"
10
11 namespace Msp {
12 namespace Net {
13
14 SockAddr *SockAddr::create(sockaddr &sa)
15 {
16         switch(sa.sa_family)
17         {
18         case AF_INET:
19                 return new InetAddr(reinterpret_cast<sockaddr_in &>(sa));
20         default:
21                 throw InvalidParameterValue("Unknown address family");
22         }
23 }
24
25 } // namespace Net
26 } // namespace Msp