this.successfullAllocation = true;
return addressAtRelayServer;
}
private synchronized void startMessageHandler(final int lifetime) {
final ThreadFactory specialThreadsFactory = new ThreadGroupThreadFactory();
final ScheduledExecutorService refreshExecutor = Executors
.newSingleThreadScheduledExecutor(specialThreadsFactory);
refreshExecutor.schedule(new RefreshAllocationTask(this.controlConnectionWriter, lifetime),
Math.max(lifetime - ALLOCATION_LIFETIME_ADVANCE, ALLOCATION_LIFETIME_MIN), TimeUnit.SECONDS);
this.messageHandlerTask = new MessageHandlerTask(this.controlConnection, this.controlConnectionWriter,
this.relayServerSocketAddress, this.socketQueue, refreshExecutor);
specialThreadsFactory.newThread(this.messageHandlerTask).start();
}