public void resendMessage(Message message, IP remoteAddress, int remotePort) throws IOException { if (remoteAddress == null) remoteAddress = IP.getLocalHost(); message.setSentStamp(getConvertedTime(remoteAddress, remotePort)); message.setMessageServer(this); try { sendBuffer.clear(); sendBuffer.put(extractor.convertMessage(message)); sendBuffer.flip(); channel.send(sendBuffer, new InetSocketAddress(remoteAddress.toString(), remotePort)); message.setRemoteAddress(remoteAddress); message.setRemotePort(remotePort); messageSent(message); } catch (IllegalAccessException exc) { throw new RuntimeException(exc); } catch (IllegalArgumentException exc) { throw new RuntimeException(exc); } catch (InvocationTargetException exc) { throw new RuntimeException(exc); } }