예제 #1
0
 private void ScheduleTimeout(SocketChannel ch, HandshakeClient handshakeClient)
 {
     ch.eventLoop().schedule(() =>
     {
         if (handshakeClient.FailIfNotDone("Timed out after " + _timeout))
         {
             _debugLog.warn("Failed handshake after timeout");
         }
     }, _timeout.toMillis(), TimeUnit.MILLISECONDS);
 }
예제 #2
0
 /// <summary>
 /// schedules the handshake initiation after the connection attempt
 /// </summary>
 private void ScheduleHandshake(SocketChannel ch, HandshakeClient handshakeClient, Org.Neo4j.causalclustering.helper.TimeoutStrategy_Timeout handshakeDelay)
 {
     ch.eventLoop().schedule(() =>
     {
         if (ch.Active)
         {
             InitiateHandshake(ch, handshakeClient);
         }
         else if (ch.Open)
         {
             handshakeDelay.Increment();
             ScheduleHandshake(ch, handshakeClient, handshakeDelay);
         }
         else
         {
             handshakeClient.FailIfNotDone("Channel closed");
         }
     }, handshakeDelay.Millis, MILLISECONDS);
 }