Package com.peterhi.working

Examples of com.peterhi.working.EndpointImpl.run()


          ex.printStackTrace();
        }
      }
    });
   
    endpoint.run();
  }
 
}
View Full Code Here


  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));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.