예제 #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("AllJoyn Library version: " + AllJoyn.GetVersion());
            Console.WriteLine("AllJoyn Library buildInfo: " + AllJoyn.GetBuildInfo());

            BasicServer basicServer = new BasicServer();
            BasicClient basicClient = new BasicClient();

            basicClient.Connect();

            while(!basicClient.Connected)
            {
                System.Threading.Thread.Sleep(1);
            }

            Console.WriteLine("BasicClient.CallRemoteMethod returned '{0}'", basicClient.CallRemoteMethod());

            while(basicServer.KeepRunning)
            {
                System.Threading.Thread.Sleep(1);
                //System.GC.Collect();
                //System.GC.WaitForPendingFinalizers();
                //System.GC.WaitForFullGCComplete();
                //System.GC.Collect();
                Console.WriteLine("BasicClient.CallRemoteMethod returned '{0}'", basicClient.CallRemoteMethod());
            }
        }
예제 #2
0
        public static void Main(string[] args)
        {
            Console.WriteLine("AllJoyn Library version: " + AllJoyn.GetVersion());
            Console.WriteLine("AllJoyn Library buildInfo: " + AllJoyn.GetBuildInfo());

            BasicServer basicServer = new BasicServer();
            BasicClient basicClient = new BasicClient();

            basicClient.Connect();

            while (!basicClient.Connected)
            {
                System.Threading.Thread.Sleep(1);
            }

            Console.WriteLine("BasicClient.CallRemoteMethod returned '{0}'", basicClient.CallRemoteMethod());

            while (basicServer.KeepRunning)
            {
                System.Threading.Thread.Sleep(1);
                //System.GC.Collect();
                //System.GC.WaitForPendingFinalizers();
                //System.GC.WaitForFullGCComplete();
                //System.GC.Collect();
                Console.WriteLine("BasicClient.CallRemoteMethod returned '{0}'", basicClient.CallRemoteMethod());
            }
        }
예제 #3
0
        public static void Main(string[] args)
        {
            Console.WriteLine("AllJoyn Library version: " + AllJoyn.GetVersion());
            Console.WriteLine("AllJoyn Library buildInfo: " + AllJoyn.GetBuildInfo());

            // Enable callbacks on main thread only
            AllJoyn.SetMainThreadOnlyCallbacks(true);

            BasicServer basicServer = new BasicServer();
            BasicClient basicClient = new BasicClient();

            basicClient.Connect();

            while (!basicClient.Connected)
            {
                AllJoyn.TriggerCallbacks();                 // Pump messages
                System.Threading.Thread.Sleep(1);
            }

            Console.WriteLine("BasicClient.CallRemoteMethod returned '{0}'", basicClient.CallRemoteMethod());

            while (basicServer.KeepRunning)
            {
                AllJoyn.TriggerCallbacks();                 // Pump messages
                System.Threading.Thread.Sleep(1);
            }
        }
    // Use this for initialization
    void Start()
    {
        Debug.Log("Starting up AllJoyn service and client");
        basicServer = new BasicServer();
        basicClient = new BasicClient();

        basicClient.Connect();
    }