/** * Send the message to the defined host. * * @param message * the message to send. */ protected void sendMessage(String message) { try { if (datagram == null) { datagram = connection.newDatagram(datagramSize); } datagram.setData(message.getBytes(encoding), 0, message.length()); connection.send(datagram); } catch (IOException e) { System.err.println("Could not send the Datagram: " + e); } }