-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
6-pool
-
generic
-
generic
small error in code example found at http://download.oracle.com/javase/tutorial/networking/datagrams/broadcasting.html
public void run() {
while (moreQuotes) {
try {
byte[] buf new byte[256]; //should be: byte[] buf = new byte[256]; or am i mistaken =S
// don't wait for request...just send a quote
String dString = null;
if (in == null)
dString = new Date().toString();
else
dString = getNextQuote();
buf = dString.getBytes();
InetAddress group = InetAddress.getByName(
"230.0.0.1");
DatagramPacket packet;
packet = new DatagramPacket(buf, buf.length,
group, 4446);
socket.send(packet);
try {
sleep((long)Math.random() * FIVE_SECONDS);
} catch (InterruptedException e) { }
} catch (IOException e) {
e.printStackTrace();
moreQuotes = false;
}
}
socket.close();
}
public void run() {
while (moreQuotes) {
try {
byte[] buf new byte[256]; //should be: byte[] buf = new byte[256]; or am i mistaken =S
// don't wait for request...just send a quote
String dString = null;
if (in == null)
dString = new Date().toString();
else
dString = getNextQuote();
buf = dString.getBytes();
InetAddress group = InetAddress.getByName(
"230.0.0.1");
DatagramPacket packet;
packet = new DatagramPacket(buf, buf.length,
group, 4446);
socket.send(packet);
try {
sleep((long)Math.random() * FIVE_SECONDS);
} catch (InterruptedException e) { }
} catch (IOException e) {
e.printStackTrace();
moreQuotes = false;
}
}
socket.close();
}