scouter.agent.netio.data.net.Test Maven / Gradle / Ivy
package scouter.agent.netio.data.net;
import java.net.DatagramSocket;
import java.net.SocketException;
import java.util.ArrayList;
public class Test {
public static void main(String[] args) throws SocketException {
ArrayList a = new ArrayList();
for(int i = 0 ; i < 10;i++){
DatagramSocket d = new DatagramSocket(0);
a.add(d);
System.out.println(d.getLocalPort());
}
}
}