public static void main(String[] args) throws Exception {
EndpointImpl endpoint = new EndpointImpl(new DatagramSocket());
SocketAddress address = new InetSocketAddress(InetAddress.getByName("www.peterhi.com"), 22222);
// SocketAddress address = new InetSocketAddress(InetAddress.getLocalHost(), 22222);
endpoint.run();
System.out.println("unreliable sent: " + endpoint.send(address, new byte[512], 0, 512, false));
long justnow = System.currentTimeMillis();
System.out.println("reliable sent: " + endpoint.send(address, new byte[507 * 65536], 0, 507 * 65536, true));
long now = System.currentTimeMillis();
System.out.println("time = " + (now - justnow));