Snippets: SocksArmor - BlackboardImport

// SOCKSArmor Snippets - SocksArmor.
// Author: Felipe Kellermann <felipek@socksarmor.org>
// Revision: $Revision: 5395 $
// Date: $Date: 2008-01-03 18:05:06 -0200 (Thu, 03 Jan 2008) $
//
// This snippet imports a blackboard to the serer.

using System;
using SocksArmor;

class SocksArmorSnippet
{
    static void Main(string[] args)
    {
        // Remote SOCKSArmor server.
        RemoteServer server = new RemoteServer();
        server.Connect("127.0.0.1", 10842, "username", "password");

        // Reads a XML stringerized representation of a blackboard.
        string blackboard = Console.ReadLine();

        // Sends the XML stringerized representation of the blackboard
        // to the server, which will reconstruct the XML from the passed
        // representation an will read and interpret all the data.
        //
        // Note that "imports" do *not* reset the server's blackboard.
        server.Blackboard.Import(blackboard);

        server.Disconnect();
    }
}