From 06734abf5f0deda12a2bbc1411b542067004f20d Mon Sep 17 00:00:00 2001 From: gareth Date: Sat, 19 May 2007 00:23:39 +0000 Subject: [PATCH] That shutdown function needs to call this.... Added nice little delay to give time for the XML-RPC response to go back to the grid manager when shutting down --- .../GridServerManager.cs | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/OpenGrid.Framework.Manager/GridServerManager.cs b/OpenGrid.Framework.Manager/GridServerManager.cs index c536e33176..5c39cc1aab 100644 --- a/OpenGrid.Framework.Manager/GridServerManager.cs +++ b/OpenGrid.Framework.Manager/GridServerManager.cs @@ -2,7 +2,7 @@ using System; using System.Collections; using System.Collections.Generic; using Nwc.XmlRpc; - +using System.Threading; namespace OpenGrid.Framework.Manager { @@ -19,18 +19,21 @@ namespace OpenGrid.Framework.Manager { Hashtable requestData = (Hashtable)request.Params[0]; Hashtable responseData = new Hashtable(); - if((string)requestData["authkey"] != recvkey) { - responseData["error"]="INVALID KEY"; - } else { - responseData["msg"]="Shutdown command accepted"; - responseData["authkey"]=sendkey; - thecallback("shutdown"); - } - + responseData["msg"]="Shutdown command accepted"; + (new Thread(new ThreadStart(ZOMGServerIsNowTerminallyIll))).Start(); response.Value = responseData; return response; } + + // Brought to by late-night coding + public static void ZOMGServerIsNowTerminallyIll() + { + Console.WriteLine("ZOMG! THIS SERVER IS TERMINALLY ILL - WE GOT A SHUTDOWN REQUEST FROM A GRID MANAGER!!!!"); + Console.WriteLine("We have 3 seconds to live..."); + Thread.Sleep(3000); + thecallback("shutdown"); + } } }