private void initializeLinkOpen(TimeoutTracker timeout)
	{
		this.linkFirstOpen = new CompletableFuture<CoreMessageSender>();

		// timer to signal a timeout if exceeds the operationTimeout on MessagingFactory
		Timer.schedule(
				new Runnable()
				{
					public void run()
					{
						if (!CoreMessageSender.this.linkFirstOpen.isDone())
						{
							CoreMessageSender.this.closeInternals(false);
							CoreMessageSender.this.setClosed();

							Exception operationTimedout = new TimeoutException(
									String.format(Locale.US, "Open operation on SendLink(%s) on Entity(%s) timed out at %s.",	CoreMessageSender.this.sendLink.getName(), CoreMessageSender.this.getSendPath(), ZonedDateTime.now().toString()),
									CoreMessageSender.this.lastKnownErrorReportedAt.isAfter(Instant.now().minusSeconds(ClientConstants.SERVER_BUSY_BASE_SLEEP_TIME_IN_SECS)) ? CoreMessageSender.this.lastKnownLinkError : null);
							TRACE_LOGGER.warn(operationTimedout.getMessage());
							ExceptionUtil.completeExceptionally(CoreMessageSender.this.linkFirstOpen, operationTimedout, CoreMessageSender.this, true);
						}
					}
				}
				, timeout.remaining()
				, TimerType.OneTimeRun);
	}
private void initializeLinkOpen ( TimeoutTracker timeout ) { this . linkFirstOpen = new CompletableFuture < CoreMessageSender > ( ) ; Timer . schedule ( new Runnable ( ) { public void run ( ) { if ( ! CoreMessageSender . this . linkFirstOpen . isDone ( ) ) { CoreMessageSender . this . closeInternals ( false ) ; CoreMessageSender . this . setClosed ( ) ; Exception operationTimedout = new TimeoutException ( String . format ( Locale . US , "Open operation on SendLink(%s) on Entity(%s) timed out at %s." , CoreMessageSender . this . sendLink . getName ( ) , CoreMessageSender . this . getSendPath ( ) , ZonedDateTime . now ( ) . toString ( ) ) , CoreMessageSender . this . lastKnownErrorReportedAt . isAfter ( Instant . now ( ) . minusSeconds ( ClientConstants . SERVER_BUSY_BASE_SLEEP_TIME_IN_SECS ) ) ? CoreMessageSender . this . lastKnownLinkError : null ) ; TRACE_LOGGER . warn ( operationTimedout . getMessage ( ) ) ; ExceptionUtil . completeExceptionally ( CoreMessageSender . this . linkFirstOpen , operationTimedout , CoreMessageSender . this , true ) ; } } } , timeout . remaining ( ) , TimerType . OneTimeRun ) ; }
TODO: consolidate common-code written for timeouts in Sender/Receiver