static void Main(string[] args) { TTransport trans = new TNamedPipeClientTransport("TradeStream"); trans.Open(); TProtocol proto = new TCompactProtocol(trans); PNWF.TradeStream.Client client = new PNWF.TradeStream.Client(proto); try { for (int i = 0; i < 100; i++) { List <PNWF.Trade> trades = client.GetNextTrade(""); foreach (PNWF.Trade trade in trades) { Console.Out.WriteLine(trade.Date_time.Hour.ToString("D2") + ":" + trade.Date_time.Minute.ToString("D2") + ":" + trade.Date_time.Second.ToString("D2") + " " + trade.Fish + "-" + trade.Market.ToString() + " " + trade.Price); } } } catch (TTransportException ex) { Console.WriteLine("Exception: " + ex.Message); } }
static void Main(string[] args) { #if SOCKET TTransport transport = new TSocket("localhost", 8080); #else TTransport transport = new TNamedPipeClientTransport("MyPipeName"); #endif TProtocol protocol = new TBinaryProtocol(transport); HelloWorld.Client client = new HelloWorld.Client(protocol); transport.Open(); String res = client.hoge("Send to Server"); Console.WriteLine(res); }
public override void Test(UpdateDelegate action) { string pipeName = "pipe123"; TTransport transport = new TNamedPipeClientTransport(pipeName); TProtocol protocol = new TBinaryProtocol(transport); PrintServices.Client client = new PrintServices.Client(protocol); m_StrTransport = "TNamedPipe"; m_StrProtocol = "TBinaryProtocol"; if (!transport.IsOpen) { transport.Open(); } testAdd(client, action); transport.Close(); }