Beispiel #1
0
    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);
    }
Beispiel #2
0
 public DataStorage(PySSSMQ_client client)
 {
     this.client = client;
 }