/// <summary> /// Used when you wish to update data in the dataStorage, and transmit to PySSSMQ-clients /// </summary> /// <param name="key"></param> /// <param name="value"></param> public void setData(String key, String value) { storeData(key, value); if (client.IsConnected()) { client.Send(key, value); } }
public void Start() { string key = "test_key"; string data = "testdata for key"; string key2 = "test_key2"; string data2 = "testdata for key2"; PySSSMQ_client client = new PySSSMQ_client(); if (!client.Connect("127.0.0.1")) { Console.WriteLine("Could not connect to server"); return; } Console.WriteLine("Connected to server"); client.AttachReceiveEvent(this.ReceiveData); Console.WriteLine("this.Recieved is attached to PySSSMQ_client"); Console.WriteLine("Pull " + key); client.Pull(key); System.Threading.Thread.Sleep(1000); Console.WriteLine("Seding to server: key = " + key + ", data = " + data); client.Send(key, data); System.Threading.Thread.Sleep(1000); Console.WriteLine("Seding to server: key = " + key2 + ", data = " + data2); client.Send(key2, data2); System.Threading.Thread.Sleep(1000); Console.WriteLine("Pull " + key); client.Pull(key); System.Threading.Thread.Sleep(1000); }