CreateConnection() public static méthode

public static CreateConnection ( Role role, IPEndPoint socketAddress, int poolSize, IChannelHandler upstreamHandler ) : Task
role Role
socketAddress System.Net.IPEndPoint
poolSize int
upstreamHandler IChannelHandler
Résultat Task
 public Controller(int initialParticipants, INode controllerPort)
 {
     _connection = RemoteConnection.CreateConnection(Role.Server, controllerPort, _settings.ServerSocketWorkerPoolSize,
                                                     new ConductorHandler(Self, Logging.GetLogger(Context.System, typeof(ConductorHandler))));
     _barrier             = Context.ActorOf(Props.Create <BarrierCoordinator>(), "barriers");
     _initialParticipants = initialParticipants;
 }
Exemple #2
0
 public Controller(int initialParticipants, IPEndPoint controllerPort)
 {
     _log.Debug("Opening connection");
     _connection = RemoteConnection.CreateConnection(Role.Server, controllerPort, _settings.ServerSocketWorkerPoolSize,
                                                     new ConductorHandler(Self, Logging.GetLogger(Context.System, typeof(ConductorHandler)))).Result;
     _log.Debug("Connection bound");
     _barrier             = Context.ActorOf(Props.Create <BarrierCoordinator>(), "barriers");
     _initialParticipants = initialParticipants;
 }
Exemple #3
0
 private void Reconnect()
 {
     _log.Debug("Connecting...");
     _nextAttempt = Deadline.Now + _backoff;
     RemoteConnection.CreateConnection(Role.Client, _server, _poolSize, this).ContinueWith(tr =>
     {
         _log.Debug("Failed to connect.... Retrying again in {0}s. {1} attemps left.", _nextAttempt.TimeLeft, _reconnects);
         if (_reconnects > 0)
         {
             _reconnects -= 1;
             if (_nextAttempt.IsOverdue)
             {
                 Reconnect();
             }
             else
             {
                 _scheduler.Advanced.ScheduleOnce(_nextAttempt.TimeLeft, Reconnect);
             }
         }
     }, TaskContinuationOptions.NotOnRanToCompletion);
 }
Exemple #4
0
 private void Reconnect()
 {
     _nextAttempt = Deadline.Now + _backoff;
     RemoteConnection.CreateConnection(Role.Client, _server, _poolSize, this);
 }