Skip to content

Instantly share code, notes, and snippets.

@rfaisal
Created October 9, 2013 17:30
Show Gist options
  • Select an option

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

Select an option

Save rfaisal/6905017 to your computer and use it in GitHub Desktop.
Simple math library implementing thrift interface
public class MathServer : Math.MathService.Iface
{
public MathServer() { }
public int add(int a, int b)
{
Console.WriteLine("Called add({0},{1})={2}", a, b, a+b);
return a + b;
}
public int sub(int a, int b)
{
Console.WriteLine("Called sub({0},{1})={2}", a, b, a - b);
return a + b;
}
public int mul(int a, int b)
{
Console.WriteLine("Called mul({0},{1})={2}", a, b, a * b);
return a + b;
}
public int div(int a, int b)
{
Console.WriteLine("Called div({0},{1})={2}", a, b, a / b);
return a / b;
}
public int mod(int a, int b)
{
Console.WriteLine("Called mod({0},{1})={2}", a, b, a % b);
return a % b;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment