Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php作为客户端发请求给go tars服务端,无法正常解析消息 #46

Closed
khadgarmage opened this issue Oct 17, 2018 · 3 comments

Comments

@khadgarmage
Copy link

tars文件:
module TestApp{
interface SayHello{
int echoHello(string name, out string greeting);
};
};
php代码:
// 指定主控ip
$config = new \Tars\client\CommunicatorConfig();
$config->setLocator('tars.tarsregistry.QueryObj@tcp -h 10.0.2.15 -p 17890');
$config->setModuleName('App.Server');
$config->setCharsetName('UTF-8');
$servant = new \TestApp\HelloGo\SayHelloObj\SayHelloServant($config);

echo "Locator specified with default socketmode 1\n";
$name = 'ted';
$intVal = $servant->echoHello($name, $greetings);
var_dump($greetings);

@khadgarmage
Copy link
Author

@sandyskies

@sandyskies
Copy link
Contributor

sandyskies commented Oct 17, 2018

The problem is caused by php ,which use iversion 2 in request package

@sandyskies
Copy link
Contributor

sandyskies commented Oct 18, 2018

use $config->setIVersion(1); to set the iverson to 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants