protected void newData( DatagramPacket packet ) { // So the tricky part here is figuring out the endpoint and // whether it's new or not. In these UDP schemes, firewalls have // to be ported back to a specific machine so we will consider // the address + port (ie: SocketAddress) the defacto unique // ID. Endpoint p = getEndpoint( packet.getSocketAddress(), true ); // We'll copy the data to trim it. byte[] data = new byte[packet.getLength()]; System.arraycopy(packet.getData(), 0, data, 0, data.length); Envelope env = new Envelope( p, data, false ); addEnvelope( env ); }
protected void newData( DatagramPacket packet ) { // So the tricky part here is figuring out the endpoint and // whether it's new or not. In these UDP schemes, firewalls have // to be ported back to a specific machine so we will consider // the address + port (ie: SocketAddress) the defacto unique // ID. Endpoint p = getEndpoint( packet.getSocketAddress(), true ); // We'll copy the data to trim it. byte[] data = new byte[packet.getLength()]; System.arraycopy(packet.getData(), 0, data, 0, data.length); Envelope env = new Envelope( p, data, false ); addEnvelope( env ); }
protected void newData( DatagramPacket packet ) { // So the tricky part here is figuring out the endpoint and // whether it's new or not. In these UDP schemes, firewalls have // to be ported back to a specific machine so we will consider // the address + port (ie: SocketAddress) the defacto unique // ID. Endpoint p = getEndpoint( packet.getSocketAddress(), true ); // We'll copy the data to trim it. byte[] data = new byte[packet.getLength()]; System.arraycopy(packet.getData(), 0, data, 0, data.length); Envelope env = new Envelope( p, data, false ); addEnvelope( env ); }