internal ThriftMessageSender(Uri serviceUri) { socket = new TSocket(serviceUri.Host, serviceUri.Port); transport = new TBufferedTransport(socket); transport.Open(); client = new MessageService.Client(new TCompactProtocol(transport)); }
private ConsuloConnector() { try { String port = Environment.GetEnvironmentVariable("TO_CONSULO_NANT_PORT"); mySocket = new TSocket("localhost", Int32.Parse(port)); myClient = new MessageService.Client(new TBinaryProtocol(mySocket)); mySocket.Open(); } catch { } }
static void Main(string[] args) { using (TSocket socket = new TSocket("localhost", 8800)) using (TTransport transport = new TBufferedTransport(socket)) using (TProtocol protocol = new TBinaryProtocol(transport)) using (var client = new MessageService.Client(protocol)) { transport.Open(); Console.WriteLine(client.sendEmailMessage()); ; } //using (TTransport transport = new TSocket("127.0.0.1", 8800)) //using (TProtocol protocol = new TBinaryProtocol(transport)) //using (var clientUser = new MessageService.Client(protocol)) //{ // transport.Open(); // Console.WriteLine(clientUser.sendEmailMessage()); //} Console.ReadKey(); }