7 |
|
// This class contains the main method to be run by |
8 |
|
// the filter children. It harvests UDP traffic. |
9 |
|
// |
10 |
– |
// |
10 |
|
public class UDPReader extends Thread{ |
11 |
|
|
12 |
|
// It is normal to use this constructor in preference |
43 |
|
boolean running = true; |
44 |
|
while (running){ |
45 |
|
try { |
46 |
+ |
|
47 |
+ |
// receive request and pass on to the FilterThread. |
48 |
|
buf = new byte[packetSizeLimit]; |
48 |
– |
// receive request |
49 |
|
DatagramPacket packet = new DatagramPacket(buf, buf.length); |
50 |
|
socket.receive(packet); |
51 |
< |
FilterThread t = new FilterThread(parent); |
52 |
< |
t.run(packet); |
51 |
> |
FilterThread t = new FilterThread(parent, packet); |
52 |
> |
t.start(); |
53 |
> |
|
54 |
|
} |
55 |
|
catch (IOException e) { |
56 |
|
logger.write(this.toString(), Logger.SYSMSG, "The UDPReader thread has been shut down as an exception occured: "+e); |