Skip to content
Snippets Groups Projects
Commit 9167d4b8 authored by Terry D. Norbraten's avatar Terry D. Norbraten
Browse files

PduFactory already wraps in a ByteBuffer

parent 2395e0bf
No related branches found
No related tags found
No related merge requests found
......@@ -75,9 +75,7 @@ public class DisThreadedNetIF
/* *********** queues and lists and public methods ************** */
private final List<PduListener> everyTypeListeners = new ArrayList<>();
private final Map<DISPDUType, List<PduListener>> typeListeners = new HashMap<>();
private final List<RawPduListener> rawListeners = new ArrayList<>();
private final LinkedBlockingQueue<Pdu> pdus2send = new LinkedBlockingQueue<>();
/**
......@@ -203,10 +201,8 @@ public class DisThreadedNetIF
socket.receive(packet); //blocks here waiting for next DIS pdu to be received on multicast IP and specified port
toRawListeners(packet.getData(), packet.getLength());
// Uses the NIO byte buffer class--wrap a ByteBuffer instance around
// the data we get from the packet
byteBuffer = ByteBuffer.wrap(packet.getData());
pdu = pduFactory.createPdu(byteBuffer);
// the PduFactory will wrap data in a ByteBuffer
pdu = pduFactory.createPdu(packet.getData());
if (pdu != null)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment