protected void write(final byte[] message) throws SyslogRuntimeException {
		if (this.socket == null) {
			createDatagramSocket(false);
		}

		final InetAddress hostAddress = getHostAddress();

		final DatagramPacket packet = new DatagramPacket(
				message,
				message.length,
				hostAddress,
				this.syslogConfig.getPort()
				);

		int attempts = 0;

		while(attempts != -1 && attempts < (this.netSyslogConfig.getWriteRetries() + 1)) {
			try {
				this.socket.send(packet);
				attempts = -1;
			} catch (final IOException ioe) {
				if (attempts == (this.netSyslogConfig.getWriteRetries() + 1)) {
					throw new SyslogRuntimeException(ioe);
				}
			}
		}
	}