MCPcopy Index your code
hub / github.com/apache/groovy / run

Method run

benchmark/bench/echo.java:33–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 }
32
33 public void run() {
34 Socket socketFromServer = null;
35 try {
36 socketFromServer = new Socket(inetaServer, iPort);
37 BufferedReader in = new BufferedReader(new InputStreamReader(socketFromServer.getInputStream()));
38 OutputStream out = socketFromServer.getOutputStream();
39
40 byte[] bytesOut = GREETING.getBytes();
41 String strIn = GREETING.trim();
42 for(int i = 0; i < iIterations; ++i) {
43 out.write(bytesOut);
44 out.flush();
45 String strRead = in.readLine();
46 if(!strRead.equals(strIn))
47 throw new RuntimeException("client: \"" + strIn + "\" ne \"" + strRead + "\"");
48 }
49 } catch(Exception e) {
50 e.printStackTrace();
51 }
52
53 try {
54 socketFromServer.close();
55 } catch(Exception e) { }
56 }
57}
58
59class EchoServer extends Thread {

Callers

nothing calls this directly

Calls 10

getOutputStreamMethod · 0.80
trimMethod · 0.80
printStackTraceMethod · 0.80
writeMethod · 0.65
equalsMethod · 0.65
closeMethod · 0.65
getInputStreamMethod · 0.45
getBytesMethod · 0.45
flushMethod · 0.45
readLineMethod · 0.45

Tested by

no test coverage detected