Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
My Java Serivce implement thrift:
i32 get_point(1:required i32 userId)
When use PHP to connect to my service, sometimes, PHP get wrong value (Java client always return right value)
Here is my PHP code:
Declare client:
$this->socket = new TSocket($this->_host, $this->_port, true);
$this->transport = new TFramedTransport($this->socket);
$this->protocol = new TBinaryProtocolAccelerated($this->transport);
$this->client = new ServiceReadClient($this->protocol);
Declare method
private function openTransport()
{
if(!$this->transport->isOpen())
}
private function closeTransport()
{
if($this->transport->isOpen())
}
public function get_point($userId)
{
$this->openTransport();
try
catch (Exception $e)
{ $this->closeTransport(); return array (); } return $data;
}
-----------------------------
When I change my thrift to
struct Point{
1:required i32 point
}
Point get_jpoint(1:required i32 userId)
Result: PHP client always return correct value.
-----------------------------
I think that is a bug of thrift.