David Reiss | 6319133 | 2009-01-06 19:49:22 +0000 | [diff] [blame] | 1 | // Distributed under the Thrift Software License |
| 2 | // |
| 3 | // See accompanying file LICENSE or visit the Thrift site at: |
| 4 | // http://developers.facebook.com/thrift/ |
| 5 | |
| 6 | using System; |
David Reiss | 6319133 | 2009-01-06 19:49:22 +0000 | [diff] [blame] | 7 | using Thrift.Transport; |
| 8 | using Thrift.Protocol; |
| 9 | using Thrift.Test; //generated code |
| 10 | |
| 11 | namespace Test |
| 12 | { |
| 13 | class Program |
| 14 | { |
| 15 | static void Main(string[] args) |
| 16 | { |
| 17 | if (args.Length == 0) |
| 18 | { |
| 19 | Console.WriteLine("must provide 'server' or 'client' arg"); |
| 20 | return; |
| 21 | } |
| 22 | |
| 23 | string[] subArgs = new string[args.Length - 1]; |
| 24 | for(int i = 1; i < args.Length; i++) |
| 25 | { |
| 26 | subArgs[i-1] = args[i]; |
| 27 | } |
| 28 | if (args[0] == "client") |
| 29 | { |
| 30 | TestClient.Execute(subArgs); |
| 31 | } |
| 32 | else if (args[0] == "server") |
| 33 | { |
| 34 | TestServer.Execute(subArgs); |
| 35 | } |
| 36 | else |
| 37 | { |
| 38 | Console.WriteLine("first argument must be 'server' or 'client'"); |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | } |