Whenever I look at real code or example socket code in books, man pages and websites, I almost always see something like:
struct sockaddr_in foo; memset(&
"struct sockaddr_in foo = { 0 };" is only valid for the first time, whereas "memset(&foo, 0, sizeof foo);" will clear it each time the function is run.