Update sockets to support udp broadcast, tidy up tcp connect