Exemple #1
0
 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();
     }
   }
 }
Exemple #2
0
 public UDPSender() throws SocketException {
   this(SingletonSocket.getInstance(), DatagramBuffer.getSentBuffer());
 }