How to set RN171 module work on UDP?
If you look at the WiFly user manual, available here, they have a section on "Sending data using UDP". The commands for setting it up are:

//enter CMD mode
//associate the network
set ip proto 1         // Enable UDP as the protocol
set ip host &lt;address&gt;  // Set the remote host’s IP address
set ip remote &lt;value&gt;  // Set the remote port on which the host listens
set ip local &lt;value&gt;   // Set the port number on which the module listens
save                   // Save the settings in the configuration file
reboot                 // Reboot the module


If you're having other problems, please describe them.