strictly demarcate usage of tcp/udp based on user preference, make udp error handling consistent with tcp