-/* $Id$
-
-This file is part of libmspnet
-Copyright © 2008 Mikkosoft Productions, Mikko Rasa
-Distributed under the LGPL
-*/
-
#include <cerrno>
#include <msp/core/refptr.h>
#include <msp/strings/formatter.h>
if(!listening)
throw InvalidState("Socket is not listening");
- sockaddr sa;
- socklen_t size=sizeof(sockaddr);
- SocketHandle new_h=::accept(handle, &sa, &size);
+ sockaddr_storage sa;
+ socklen_t size=sizeof(sockaddr_storage);
+ SocketHandle new_h=::accept(handle, reinterpret_cast<sockaddr *>(&sa), &size);
RefPtr<SockAddr> paddr=SockAddr::create(sa);
return new StreamSocket(new_h, *paddr);