3 This file is part of libmspnet
4 Copyright © 2008, 2011 Mikkosoft Productions, Mikko Rasa
5 Distributed under the LGPL
8 #include <msp/core/except.h>
15 unsigned SockAddr::fill_sockaddr(sockaddr_storage &sa) const
17 return fill_sockaddr(reinterpret_cast<sockaddr &>(sa));
20 SockAddr *SockAddr::create(const sockaddr_storage &sa)
25 return new InetAddr(reinterpret_cast<const sockaddr_in &>(sa));
27 return new Inet6Addr(reinterpret_cast<const sockaddr_in6 &>(sa));
29 throw InvalidParameterValue("Unknown address family");