check socket type before starting receive loop