49 void SocketAddress::
init() {
50 if (sunPath.length() <
sizeof(sockAddr.sun_path)) {
51 const std::size_t len = sunPath.length();
52 std::memcpy(sockAddr.sun_path, sunPath.data(), len);
53 sockAddr.sun_path[len] = 0;
54 sockAddrLen =
static_cast<SockLen>(offsetof(sockaddr_un, sun_path) + len + 1);
56 throw core::socket::SocketAddress::BadSocketAddress(
57 core::socket::STATE_FATAL,
58 "Unix-Domain error sun-path to long: Lenght is = " + std::to_string(sunPath.length()) +
59 ", should be: " + std::to_string(
sizeof(sockAddr.sun_path) - 1),