MCPcopy Create free account
hub / github.com/apache/tomcat / run

Method run

test/org/apache/catalina/tribes/TesterMulticast.java:109–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107 private volatile boolean run = true;
108
109 @Override
110 public void run() {
111 try (MulticastSocket s = new MulticastSocket(PORT)) {
112 s.setOption(StandardSocketOptions.IP_MULTICAST_LOOP, Boolean.valueOf(true));
113 s.joinGroup(new InetSocketAddress(INET_ADDRESS, 0), null);
114 DatagramPacket p = new DatagramPacket(new byte[4], 4);
115 p.setAddress(INET_ADDRESS);
116 p.setPort(PORT);
117 long counter = 0;
118 String msg;
119 while (run) {
120 msg = String.format("%04d", Long.valueOf(counter));
121 p.setData(msg.getBytes());
122 System.out.println("Tx: " + msg);
123 s.send(p);
124 counter++;
125 Thread.sleep(500);
126 }
127 } catch (Exception e) {
128 e.printStackTrace();
129 }
130 }
131
132 public void stop() {
133 run = false;

Callers

nothing calls this directly

Calls 9

setAddressMethod · 0.65
setPortMethod · 0.65
formatMethod · 0.65
sendMethod · 0.65
printStackTraceMethod · 0.65
valueOfMethod · 0.45
setDataMethod · 0.45
getBytesMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected