aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGrid.Framework.Manager/GridServerManager.cs
diff options
context:
space:
mode:
authorgareth2007-05-19 00:23:39 +0000
committergareth2007-05-19 00:23:39 +0000
commit06734abf5f0deda12a2bbc1411b542067004f20d (patch)
tree8ca28abb033028a7c334ccb0ee9e38567d7d4801 /OpenGrid.Framework.Manager/GridServerManager.cs
parentFinished off the shutdown function (diff)
downloadopensim-SC_OLD-06734abf5f0deda12a2bbc1411b542067004f20d.zip
opensim-SC_OLD-06734abf5f0deda12a2bbc1411b542067004f20d.tar.gz
opensim-SC_OLD-06734abf5f0deda12a2bbc1411b542067004f20d.tar.bz2
opensim-SC_OLD-06734abf5f0deda12a2bbc1411b542067004f20d.tar.xz
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
Diffstat (limited to '')
-rw-r--r--OpenGrid.Framework.Manager/GridServerManager.cs21
1 files changed, 12 insertions, 9 deletions
diff --git a/OpenGrid.Framework.Manager/GridServerManager.cs b/OpenGrid.Framework.Manager/GridServerManager.cs
index c536e33..5c39cc1 100644
--- a/OpenGrid.Framework.Manager/GridServerManager.cs
+++ b/OpenGrid.Framework.Manager/GridServerManager.cs
@@ -2,7 +2,7 @@ using System;
2using System.Collections; 2using System.Collections;
3using System.Collections.Generic; 3using System.Collections.Generic;
4using Nwc.XmlRpc; 4using Nwc.XmlRpc;
5 5using System.Threading;
6 6
7namespace OpenGrid.Framework.Manager { 7namespace OpenGrid.Framework.Manager {
8 8
@@ -19,18 +19,21 @@ namespace OpenGrid.Framework.Manager {
19 Hashtable requestData = (Hashtable)request.Params[0]; 19 Hashtable requestData = (Hashtable)request.Params[0];
20 Hashtable responseData = new Hashtable(); 20 Hashtable responseData = new Hashtable();
21 21
22 if((string)requestData["authkey"] != recvkey) { 22 responseData["msg"]="Shutdown command accepted";
23 responseData["error"]="INVALID KEY"; 23 (new Thread(new ThreadStart(ZOMGServerIsNowTerminallyIll))).Start();
24 } else {
25 responseData["msg"]="Shutdown command accepted";
26 responseData["authkey"]=sendkey;
27 thecallback("shutdown");
28 }
29
30 24
31 response.Value = responseData; 25 response.Value = responseData;
32 return response; 26 return response;
33 } 27 }
28
29 // Brought to by late-night coding
30 public static void ZOMGServerIsNowTerminallyIll()
31 {
32 Console.WriteLine("ZOMG! THIS SERVER IS TERMINALLY ILL - WE GOT A SHUTDOWN REQUEST FROM A GRID MANAGER!!!!");
33 Console.WriteLine("We have 3 seconds to live...");
34 Thread.Sleep(3000);
35 thecallback("shutdown");
36 }
34 } 37 }
35} 38}
36 39