Problem with UDP packets

Can you show it how to do it with a code?