| | |
| | | import java.util.concurrent.atomic.AtomicLong; |
| | | |
| | | import dell_system.MessageViewPanel; |
| | | import dell_targets.Dell_SystemConfiguration; |
| | | |
| | | public class UDPPortAReceiver { |
| | | public static final int PORT = 8234; |
| | | public static final int PORT =Dell_SystemConfiguration.hexport; |
| | | @SuppressWarnings("unused") |
| | | private static final int MAX_DEVICES = 50000; |
| | | private static final AtomicLong packetCount = new AtomicLong(0); |
| | |
| | | PacketProcessingSystem.storePacket(ip, port, hexData); |
| | | // 报文查看窗口显示数据 |
| | | MessageViewPanel.showData(hexData, ip, port, PORT,"1"); |
| | | |
| | | // +++ 增加包计数 +++ |
| | | packetCount.incrementAndGet(); // 关键修复:增加计数器 |
| | | } catch (Exception e) { |
| | | System.err.println("Error processing UDP-A packet: " + e.getMessage()); |
| | | } |
| | |
| | | return data; |
| | | } |
| | | |
| | | // 获取接收到的数据包总数 |
| | | public static long getPacketCount() { |
| | | return packetCount.get(); |
| | | } |
| | | |
| | | } |