Reciever.java 722 B

12345678910111213141516171819202122232425262728293031
  1. package com.oblivm.backend.util;
  2. import org.apache.commons.cli.ParseException;
  3. public class Reciever<T> extends com.oblivm.backend.network.Server implements Runnable {
  4. public void run() {
  5. try {
  6. listen(54321);
  7. while (true) {
  8. byte[] res = new byte[65536];// 1024*1024bits
  9. double t = System.nanoTime();
  10. os.write(res);
  11. double t2 = System.nanoTime();
  12. System.out.println((t2 - t) / 1000000000);
  13. }
  14. } catch (Exception e) {
  15. e.printStackTrace();
  16. System.exit(1);
  17. }
  18. }
  19. @SuppressWarnings("rawtypes")
  20. public static void main(String[] args)
  21. throws ParseException, ClassNotFoundException, InstantiationException, IllegalAccessException {
  22. Reciever r = new Reciever();
  23. r.run();
  24. }
  25. }