在我用 C# 编写的客户端中出现此错误。我的服务器在 python 中。这是我第一个使用 Thrift 的测试程序。看起来我的 python 服务器正在运行。这是我的客户代码。我在调用“Client.add(2,3)”时收到此错误
static void Main(string[] args)
{
try
{
var socket = new TSocket("localhost", 9089);
var transport = new TBufferedTransport(socket);
var protocol = new TBinaryProtocol(transport);
var client = new CalculatorService.Client(protocol);
transport.Open();
if (transport.IsOpen)
{
//I am seeing this message
Console.WriteLine("server is open for business");
}
Console.WriteLine(client.add(2, 3)); //this is the line that gives me the error
transport.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
任何帮助将不胜感激。