<commit_before>using System;
using System.Collections;
using System.Collections.Generic;
using Nwc.XmlRpc;


namespace OpenGrid.Framework.Manager {

	public class GridServerManager 
	{
		public static GridManagerCallback thecallback;

		public static string sendkey;
		public static string recvkey;

		public static XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request)
         	{
           		XmlRpcResponse response = new XmlRpcResponse();
            		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");	
	    		} 


	    		response.Value = responseData;
	    		return response;
		}
	 }
}

<commit_msg>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<commit_after>using System;
using System.Collections;
using System.Collections.Generic;
using Nwc.XmlRpc;
using System.Threading;

namespace OpenGrid.Framework.Manager {

	public class GridServerManager 
	{
		public static GridManagerCallback thecallback;

		public static string sendkey;
		public static string recvkey;

		public static XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request)
         	{
           		XmlRpcResponse response = new XmlRpcResponse();
            		Hashtable requestData = (Hashtable)request.Params[0];
	    		Hashtable responseData = new Hashtable();
           
			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");
		}
	 }
}


{'fraction_non_alphanumeric': 0.08638025594149909, 'fraction_numerical': 0.0031992687385740404, 'mean_word_length': 3.4491869918699187, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4255904', 'n_tokens_mistral': 710, 'n_tokens_neox': 628, 'n_words': 167}