2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
21 using System.Collections.Generic;
22 using Thrift.Collections;
23 using Thrift.Transport;
24 using Thrift.Protocol;
29 namespace Test.Multiplex.Client
31 public class TestClient
33 static void Execute(int port)
38 trans = new TSocket("localhost", port);
39 trans = new TFramedTransport(trans);
42 TProtocol Protocol = new TBinaryProtocol(trans, true, true);
44 TMultiplexedProtocol multiplex;
46 multiplex = new TMultiplexedProtocol(Protocol, Constants.NAME_BENCHMARKSERVICE);
47 BenchmarkService.Iface bench = new BenchmarkService.Client(multiplex);
49 multiplex = new TMultiplexedProtocol(Protocol, Constants.NAME_AGGR);
50 Aggr.Iface aggr = new Aggr.Client(multiplex);
52 for (sbyte i = 1; 10 >= i; ++i)
54 aggr.addValue(bench.fibonacci(i));
57 foreach (int k in aggr.getValues())
59 Console.Write(k.ToString() + " ");
60 Console.WriteLine("");
66 Console.WriteLine(e.Message);
70 static void Main(string[] args)
75 port = ushort.Parse(args[0]);
78 Console.WriteLine("done.");