public bool RunClicked(string myIP, string myPort)
{
string[] target = owner.Split(':');
string ip = target[0];
string port = target[1];
MessageGenerator mg = new MessageGenerator();
string request = mg.msgRunRequest(Pid, myIP + ":" + myPort);
AsynchronousClient client = new AsynchronousClient();
client.SetSingleMsg(ip, port, request);
Thread t = new Thread(new ThreadStart(client.SendSingleClient));
t.IsBackground = true;
t.Start();
while (StartFlag == "")
Thread.Sleep(500);
if (StartFlag == "Fail")
return false;
else
{
setMaster(myIP + ":" + myPort);
setBackUp(selectBackUp());
if (rnBtnClicked != null)
rnBtnClicked(true);
if (permissions.Count > 1)
{
List<string> endPoints = Peers();
Hashtable temp = conn.GetIPtoPeer();
Hashtable tempToSend = new Hashtable();
foreach (DictionaryEntry item in temp)
{
if (endPoints.Contains(item.Key.ToString()))
{
tempToSend.Add(item.Key, item.Value);
}
}
AsynchronousClient client1 = new AsynchronousClient();
client1.SetMultiMsg(tempToSend, getMasterBackUpXML(), myIP + ":" + myPort);
Thread t1 = new Thread(new ThreadStart(client1.SendMultiClient));
t1.IsBackground = true;
t1.Start();
}
return true;
}
}
public bool ReRunClicked(string myIP, string myPort)