protected void cycleOperation() { if (!socket.isClosed()) { try { while (!buffer.isEmpty()) { DatagramPacket packet = (DatagramPacket) buffer.remove(); socket.send(packet); logger.debug("Sent packet to " + packet.getSocketAddress()); } } catch (IOException e) { e.printStackTrace(); } } }
public UDPSender() throws SocketException { this(SingletonSocket.getInstance(), DatagramBuffer.getSentBuffer()); }