MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / main

Method main

test/test/wall/SocketTest.java:25–44  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

23 public static final int PORT = 1234;
24
25 public static void main(String[] args) throws Exception {
26 ServerSocket s = new ServerSocket(PORT);
27
28 new IdleClient().start();
29 OutputStream idleClient = s.accept().getOutputStream();
30
31 new BusyClient().start();
32 OutputStream busyClient = s.accept().getOutputStream();
33
34 byte[] buf = new byte[4096];
35 ThreadLocalRandom.current().nextBytes(buf);
36
37 for (int i = 0; ; i++) {
38 if ((i % 10_000_000) == 0) {
39 idleClient.write(buf, 0, 1);
40 } else {
41 busyClient.write(buf);
42 }
43 }
44 }
45}

Callers

nothing calls this directly

Calls 4

acceptMethod · 0.80
currentMethod · 0.80
startMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected