public void run(){
  closed=false;
  thread=Thread.currentThread();
  do {
    try {
      byte[] message=sendQueue.take();
      DatagramPacket req=requests.remove(ModbusUtil.registersToInt(message));
      if (req != null) {
        DatagramPacket res=new DatagramPacket(message,message.length,req.getAddress(),req.getPort());
        socket.send(res);
        logger.debug("Sent package from queue");
      }
    }
 catch (    Exception ex) {
      if (running) {
        logger.error("Problem reading UDP socket",ex);
      }
    }
  }
 while (running);
  closed=true;
}

public void run ( ) { closed = false ; thread = Thread . currentThread ( ) ; do { try { byte [ ] message = sendQueue . take ( ) ; DatagramPacket req = requests . remove ( ModbusUtil . registersToInt ( message ) ) ; if ( req != null ) { DatagramPacket res = new DatagramPacket ( message , message . length , req . getAddress ( ) , req . getPort ( ) ) ; socket . send ( res ) ; logger . debug ( "Sent package from queue" ) ; } } catch ( Exception ex ) { if ( running ) { logger . error ( "Problem reading UDP socket" , ex ) ; } } } while ( running ) ; closed = true ; }
thread loop that sends messages
