1,在有外网ip的机器上启动server. package udp; import java.net.DatagramPacket; import java.net.InetSocketAddress; public class Server extends UDPAgent { public static void main(String[] args) throws Exception { new Server(2008).start(); } public Server(int port)