Hmm...
I guess you're confusing UDP with multicasting/broadcasting.
UDP works well with swithes in unicasting (just one target machine or IP address) and even multicasting/broadcasting.
Multicasting and broadcasting "should" work on switches, if they are enabled to do so. Some switches discard multitarget packets by default, if they are not ARP or RARP packets, of course.
Note that this behaviour only occurs on "smart" switches that can be managed.
Routers will discard broadcast packets.