thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From King JKing <beuk...@gmail.com>
Subject Wrong data return when connect from PHP - Java Thrift Service
Date Tue, 08 Mar 2011 08:26:51 GMT
Dear all,

I use PHP to get value from my Java Thrift Service (Implement THaHsServer).
Here is my PHP code:
        $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);
But sometimes, PHP get wrong value. I also use Java client to check. Java
client always return right value.

Here is my thrift file
i32 get_point(1:required i32 userId)

I change to:
struct Point{
    1:required i32 point
}
Point get_point(1:required i32 userId)
Now PHP always return right value.

That maybe the problem when using PHP to connect to Java Service. Now I
always use Struct for return value instead of primitive value.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message