CreateConnection() 공개 정적인 메소드

public static CreateConnection ( Role role, IPEndPoint socketAddress, int poolSize, IChannelHandler upstreamHandler ) : Task
role Role
socketAddress System.Net.IPEndPoint
poolSize int
upstreamHandler IChannelHandler
리턴 Task
예제 #1
0
 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;
 }
예제 #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;
 }
예제 #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);
 }
예제 #4
0
 private void Reconnect()
 {
     _nextAttempt = Deadline.Now + _backoff;
     RemoteConnection.CreateConnection(Role.Client, _server, _poolSize, this);
 }