#include <msp/core/systemerror.h>
#include <msp/io/handle_private.h>
#include <msp/strings/format.h>
+#include "sockaddr_private.h"
#include "socket_private.h"
#include "streamlistensocket.h"
#include "streamsocket.h"
if(!listening)
throw bad_socket_state("not listening");
- sockaddr_storage sa;
- socklen_t size = sizeof(sockaddr_storage);
+ SockAddr::SysAddr sa;
Private new_p;
- new_p.handle = ::accept(priv->handle, reinterpret_cast<sockaddr *>(&sa), &size);
+ new_p.handle = ::accept(priv->handle, reinterpret_cast<sockaddr *>(&sa.addr), &sa.size);
- RefPtr<SockAddr> paddr = SockAddr::create(sa);
+ RefPtr<SockAddr> paddr = SockAddr::from_sys(sa);
return new StreamSocket(new_p, *paddr);
}