Exemple #1
0
 public EAnpBaseThread(EAnpBaseBroker broker)
 {
     Broker = broker;
 }
Exemple #2
0
        public void Setup(bool clientFlag)
        {
            ClientFlag = clientFlag;
            if (ClientFlag) Broker = new EAnpClientBroker();
            else Broker = new EAnpServerBroker();
            Broker.OnClose += HandleBrokerClosed;
            Broker.OnChannelOpen += HandleChannelOpen;
            Broker.Start();

            if (clientFlag)
            {
                String wslPath = "C:/test.wsl";
                AnpMsg m = null;

                // Register, create a workspace, export it.
            #if false
                m = QueueCmd(EAnpCmd.RegisterKps);
                m.AddUInt32(1);
                m.AddString("deploy");
                m.AddString("*****@*****.**");
                m.AddString("test1");

                m = QueueCmd(EAnpCmd.CreateKws);
                m.AddString("test EtFake");
                m.AddUInt32(0);

                m = QueueCmd(EAnpCmd.ExportKws);
                m.AddUInt64(0);
                m.AddString(wslPath);

            #else
                // Import a workspace.
                m = QueueCmd(EAnpCmd.ImportKws);
                m.AddString(File.ReadAllText(wslPath));
            #endif

                // Miscellaneous commands.

                // Notice that this one is slow enough to make the workspace
                // come online, on join.
            #if false
                m = QueueCmd(EAnpCmd.LookupRecAddr);
                m.AddUInt32(1);
                m.AddString("*****@*****.**");
            #endif

            #if false
                m = QueueCmd(EAnpCmd.SetLoginPwd);
                m.AddUInt64(1);
                m.AddString("foobara");
            #endif

            #if false
                m = QueueCmd(EAnpCmd.InviteKws);
                m.AddUInt64(1);
                m.AddUInt32(1);
                m.AddString("hello");
                m.AddUInt32(1);
                m.AddString("Test 2");
                m.AddString("*****@*****.**");
                m.AddUInt64(0);
                m.AddString("");
                m.AddString("");
            #endif

            #if false
                m = QueueCmd(EAnpCmd.ChatPostMsg);
                m.AddUInt64(1);
                m.AddUInt32(0);
                m.AddString("Hey there");
            #endif

            #if false
                m = QueueCmd(EAnpCmd.VncCreateSession);
                m.AddUInt64(1);
                m.AddUInt32(1);
                m.AddString("Foobar");
            #endif

            #if false
                m = QueueCmd(EAnpCmd.SetKwsTask);
                m.AddUInt64(1);
                m.AddUInt32((uint)KwsTask.DeleteRemotely);
            #endif
            }
        }
Exemple #3
0
 public EAnpChannel(EAnpBaseBroker broker, UInt64 channelID)
 {
     m_broker = broker;
     InternalChannelID = channelID;
 }