Added the ability to toggle between udp and tcp connections.