Suggest placing this block before the sockAddr part, so you initialize the variables in the sequence you use them.