             addr.sin6_addr = in6addr_any
         #else
             var addr = sockaddr_in6()
-            addr.sin6_len = __uint8_t(sizeof(sockaddr_in6))
+            addr.sin6_len = __uint8_t(sizeof(sockaddr_in6.self))
             addr.sin6_family = sa_family_t(AF_INET6)
             addr.sin6_port = Socket.htonsPort(port)
             addr.sin6_addr = in6addr_any
         #endif
         
         var bind_addr = sockaddr()
-        memcpy(&bind_addr, &addr, Int(sizeof(sockaddr_in6)))
-        
-        if bind(socketFileDescriptor, &bind_addr, socklen_t(sizeof(sockaddr_in6))) == -1 {
+        memcpy(&bind_addr, &addr, Int(sizeof(sockaddr_in6.self)))
+        
+        if bind(socketFileDescriptor, &bind_addr, socklen_t(sizeof(sockaddr_in6.self))) == -1 {
             let myErrno = errno
             let details = Socket.descriptionOfLastError()
             Socket.releaseIgnoringErrors(socketFileDescriptor)

        #else
            // Prevents crashes when blocking calls are pending and the app is paused ( via Home button ).
            var no_sig_pipe: Int32 = 1
            setsockopt(socketFileDescriptor, SOL_SOCKET, SO_NOSIGPIPE, &no_sig_pipe, socklen_t(sizeof(Int32)))
        #endif
    }
    

        // in6addr_any — binding to in6addr_loopback will effectively rule out
        // IPv4 addresses):
        //
        if setsockopt(socketFileDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, &sockoptValueNO, socklen_t(sizeof(Int32.self))) == -1 {
            let details = Socket.descriptionOfLastError()
            Socket.releaseIgnoringErrors(socketFileDescriptor)
            throw SocketError.socketSettingIPV6OnlyFailed(details)
