Skip to content

Instantly share code, notes, and snippets.

@rfaisal
Created October 9, 2013 20:05
Show Gist options
  • Select an option

  • Save rfaisal/6907441 to your computer and use it in GitHub Desktop.

Select an option

Save rfaisal/6907441 to your computer and use it in GitHub Desktop.
Thrift java client for the math library
public class MathClient {
public static void main(String[] args) throws TException{
TTransport transport = new TSocket("localhost", 9095);
transport.open();
TProtocol protocol = new TBinaryProtocol(transport);
MathService.Client client = new MathService.Client(protocol);
System.out.println(client.add(10, 20));
System.out.println(client.sub(10, 20));
System.out.println(client.mul(10, 20));
System.out.println(client.div(10, 20));
System.out.println(client.mod(10, 20));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment