addrlen
addrlen is a conventional variable name used in socket programming to denote the length of a socket address structure, typically a value used with operations involving storing or providing a socket address. In many APIs, the address is stored in a struct such as sockaddr, sockaddr_in, or sockaddr_in6, and addrlen specifies the size of that structure.
In POSIX systems, the length is typically of type socklen_t. In Windows Sockets, the corresponding parameter
Best practices include initializing addrlen to the size of the buffer you pass (e.g., sizeof(struct sockaddr_storage))
Using portable types like sockaddr_storage for temporary buffers, and socklen_t for the length when possible, helps
See also socklen_t, sockaddr, getsockname, getpeername, accept, sendto, recvfrom.