37 |
|
|
38 |
|
System.out.println("UDPReader ready and listening for UDP packets on port "+port); |
39 |
|
|
40 |
+ |
byte[] buf; |
41 |
+ |
UDPReaderThread t = new UDPReaderThread(); |
42 |
+ |
|
43 |
|
boolean running = true; |
44 |
|
while (running){ |
45 |
|
try { |
46 |
< |
byte[] buf = new byte[packetSizeLimit]; |
46 |
> |
buf = new byte[packetSizeLimit]; |
47 |
|
// receive request |
48 |
|
DatagramPacket packet = new DatagramPacket(buf, buf.length); |
49 |
|
socket.receive(packet); |
50 |
< |
UDPReaderThread thread = new UDPReaderThread(packet); |
48 |
< |
thread.run(); |
50 |
> |
t.run(packet); |
51 |
|
} |
52 |
|
catch (IOException e) { |
53 |
|
System.out.println("An exception occured in the UDPReader!"); |