public void RunExpt1()
        {
            var server = new ThriftExptServer();
            // Spawn the server in the background as a Task
            // (abstraction over threads, see http://msdn.microsoft.com/EN-US/library/dd235678%28v=VS.110,d=hv.2%29.aspx)
            // note that this experiment is multi-threaded, but the server itself is NOT (future consideration)
            var serverTask = new Task(server.Begin);
            serverTask.Start();

            // Run a client(s)
            var client = new ThriftExptClient();
            // We run till any result is 0 (an arbitrary choice for this experiment)
            while (client.Run() !=0)
            {
            }

            // Close the server to free up the port
            server.End();
        }
Example #2
0
        public void RunExpt1()
        {
            var server = new ThriftExptServer();
            // Spawn the server in the background as a Task
            // (abstraction over threads, see http://msdn.microsoft.com/EN-US/library/dd235678%28v=VS.110,d=hv.2%29.aspx)
            // note that this experiment is multi-threaded, but the server itself is NOT (future consideration)
            var serverTask = new Task(server.Begin);

            serverTask.Start();

            // Run a client(s)
            var client = new ThriftExptClient();

            // We run till any result is 0 (an arbitrary choice for this experiment)
            while (client.Run() != 0)
            {
            }

            // Close the server to free up the port
            server.End();
        }