/// <summary> /// Connect to the Manager /// </summary> public void Connect() { //TODO FIX RECONNECT PROPERLY. logger.Info("Connecting...."); //EndPoint rep = new EndPoint( // _Config.ManagerHost, // _Config.ManagerPort, // RemotingMechanism.TcpBinary // ); EndPoint rep = _Config.ManagerEndPoint.GetEndPoint(); logger.Debug("Created remote-end-point"); //EndPoint oep = new EndPoint(_Config.OwnPort, RemotingMechanism.TcpBinary); EndPoint oep = _Config.OwnEndPoint.GetEndPoint(); logger.Debug("Created own-end-point"); // connect to manager _Executor = new GExecutor(rep, oep, _Config.Id, _Config.Dedicated, _Config.AutoRevertToNDE, new SecurityCredentials(_Config.Username, _Config.Password), ExecutorUtil.BaseDirectory); _Config.ConnectVerified = true; _Config.Id = _Executor.Id; _Config.Dedicated = _Executor.Dedicated; _Executor.GotDisconnected += new GotDisconnectedEventHandler(GExecutor_GotDisconnected); _Executor.NonDedicatedExecutingStatusChanged += new NonDedicatedExecutingStatusChangedEventHandler(GExecutor_NonDedicatedExecutingStatusChanged); _Config.Serialize(); logger.Info("Connected successfully."); }
/// <summary> /// Disconnects from the Manager /// </summary> public void Disconnect() { if (Connected) { _Executor.Disconnect(); _Executor = null; logger.Info("Disconnected successfully."); } }
internal HeartbeatWorker(GExecutor executor) { _stop = false; _HeartbeatInterval = DEFAULT_INTERVAL; _executor = executor; }
public void Connect() { logger.Info("Connecting...."); if (ExecConnectEvent != null) { ExecConnectEvent("Connecting....", 0); } Executors = new GExecutor[GetNumberOfExecutors()]; for (int executorIndex = 0; executorIndex < Executors.Length; executorIndex++) { RemoteEndPoint rep = new RemoteEndPoint( Config.ManagerHost, Config.ManagerPort, RemotingMechanism.TcpBinary ); logger.Debug("Created remote-end-point"); if (ExecConnectEvent != null) { ExecConnectEvent("Created remote-end-point", 20); } // TODO: kind of hack-ish way of determining the port for higher thread numbers OwnEndPoint oep = new OwnEndPoint( Config.OwnPort + executorIndex, RemotingMechanism.TcpBinary ); logger.Debug("Created own-end-point"); if (ExecConnectEvent != null) { ExecConnectEvent("Created own-end-point", 40); } string executorId = Config.GetIdAtLocation(executorIndex); // the executorId is used in the remoting URI so it MUST be initialized here if (executorId == String.Empty) { executorId = Guid.NewGuid().ToString(); } // connect to manager Executors[executorIndex] = new GExecutor(rep, oep, executorId, Config.Dedicated, new SecurityCredentials(Config.Username, Config.Password), AppDomain.CurrentDomain.BaseDirectory); if (ExecConnectEvent != null) { ExecConnectEvent("Updating executor configuration.", 80); } Config.ConnectVerified = true; Config.SetIdAtLocation(executorIndex, Executors[executorIndex].Id); Config.Dedicated = Executors[executorIndex].Dedicated; if (ExecConnectEvent != null) { ExecConnectEvent("Saved configuration.", 60); } if (ExecConnectEvent != null) { ExecConnectEvent("Connected successfully.", 100); } Executors[executorIndex].GotDisconnected += new GotDisconnectedEventHandler(GExecutor_GotDisconnected); Executors[executorIndex].NonDedicatedExecutingStatusChanged += new NonDedicatedExecutingStatusChangedEventHandler(GExecutor_NonDedicatedExecutingStatusChanged); } Config.Slz(); Config.ConnectVerified = true; logger.Info("Connected successfully."); }
public void Connect() { logger.Info("Connecting...."); if (ExecConnectEvent!=null){ ExecConnectEvent("Connecting....",0); } Executors = new GExecutor[GetNumberOfExecutors()]; for (int executorIndex = 0; executorIndex < Executors.Length; executorIndex++) { RemoteEndPoint rep = new RemoteEndPoint( Config.ManagerHost, Config.ManagerPort, RemotingMechanism.TcpBinary ); logger.Debug("Created remote-end-point"); if (ExecConnectEvent!=null) { ExecConnectEvent("Created remote-end-point",20); } // TODO: kind of hack-ish way of determining the port for higher thread numbers OwnEndPoint oep = new OwnEndPoint( Config.OwnPort + executorIndex, RemotingMechanism.TcpBinary ); logger.Debug("Created own-end-point"); if (ExecConnectEvent!=null) { ExecConnectEvent("Created own-end-point",40); } string executorId = Config.GetIdAtLocation(executorIndex); // the executorId is used in the remoting URI so it MUST be initialized here if (executorId == String.Empty) { executorId = Guid.NewGuid().ToString(); } // connect to manager Executors[executorIndex] = new GExecutor(rep, oep, executorId, Config.Dedicated, new SecurityCredentials(Config.Username, Config.Password), AppDomain.CurrentDomain.BaseDirectory); if (ExecConnectEvent!=null) { ExecConnectEvent("Updating executor configuration.",80); } Config.ConnectVerified = true; Config.SetIdAtLocation(executorIndex, Executors[executorIndex].Id); Config.Dedicated = Executors[executorIndex].Dedicated; if (ExecConnectEvent!=null) { ExecConnectEvent("Saved configuration.",60); } if (ExecConnectEvent!=null) { ExecConnectEvent("Connected successfully.",100); } Executors[executorIndex].GotDisconnected += new GotDisconnectedEventHandler(GExecutor_GotDisconnected); Executors[executorIndex].NonDedicatedExecutingStatusChanged += new NonDedicatedExecutingStatusChangedEventHandler(GExecutor_NonDedicatedExecutingStatusChanged); } Config.Slz(); Config.ConnectVerified = true; logger.Info("Connected successfully."); }
internal NonDedicatedExecutorWorker(GExecutor executor) { _executor = executor; _stop = false; _EmptyThreadInterval = DEFAULT_EMPTYTHREAD_INTERVAL; }