mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2025-05-11 09:07:22 +00:00
Update MulticastController.java
Small update to ignore a test message to Multicast controller which will probably never be sent anyway.
This commit is contained in:
parent
f7a6138774
commit
68ade16b39
@ -31,6 +31,8 @@ public class MulticastController extends CommandManager {
|
||||
private byte[] byteBuffer = new byte[MAX_COMMAND_LENGTH];
|
||||
private DatagramPacket lastDatagram;
|
||||
|
||||
private String testString = "Multicast Networking test complete";
|
||||
|
||||
public MulticastController(PamController pamController) {
|
||||
super(pamController, unitName);
|
||||
this.pamController = pamController;
|
||||
@ -89,9 +91,25 @@ public class MulticastController extends CommandManager {
|
||||
// System.out.println("********************************* Multicast String:" + str);
|
||||
// str = str.substring(0, datagram.getLength());
|
||||
// System.out.println("Datagram received \"" + str + "\"");
|
||||
|
||||
interpretCommand(str, datagram.getData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean interpretCommand(String commandString, byte[] commandBytes) {
|
||||
// just in case this is the test string used to trigger the firewall, try to ignore it.
|
||||
try {
|
||||
if (commandString.trim().equals(testString)) {
|
||||
System.out.println(commandString);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
||||
}
|
||||
return super.interpretCommand(commandString, commandBytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendData(ExtCommand extCommand, String dataString) {
|
||||
if (dataString == null || dataString.length() == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user