Java tutorial
import java.net.DatagramPacket; import java.net.DatagramSocket; public class Main { private final static int BUFSIZE = 20; public static void main(String args[]) { try { int port = 80; DatagramSocket ds = new DatagramSocket(port); byte buffer[] = new byte[BUFSIZE]; while (true) { DatagramPacket dp = new DatagramPacket(buffer, buffer.length); dp.setPort(9090); } } catch (Exception e) { e.printStackTrace(); } } }