thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samir Mulder <samir.mul...@gmail.com>
Subject Re: generated php code, what are the values of the constructor param?
Date Fri, 18 Sep 2009 17:21:42 GMT
Also before making a server call you'll need to open the transport.  
Like:

$transport->open();
$rec = $client->someFunction(whatever arguments...);
print $rec . "\n";

$transport->close();

Hope this helps.

Samir

On Sep 18, 2009, at 10:18 AM, Samir Mulder wrote:

> You need to pass in a protocol object. Like:
>
> $socket = new Socket('localhost', 5013);
> $transport = new BufferedTransport($socket, 1024, 1024);
> $protocol = new BinaryProtocol($transport);
> $client = new SimonSaysClient($protocol);
>
> I'm not using the latest Thrift but I assume this hasn't changed.
>
> Thanks.
>
> Samir
>
> On Sep 18, 2009, at 10:14 AM, Simon Chu wrote:
>
>> class SimonSaysClient implements SimonSaysIf {
>> protected $input_ = null;
>> protected $output_ = null;
>>
>> protected $seqid_ = 0;
>>
>> public function __construct($input, $output=null) {
>>   $this->input_ = $input;
>>   $this->output_ = $output ? $output : $input;
>> }
>>
>>
>> The above code was generated, what are the expected values of  
>> $input and
>> $output?  I put in the facebook thrift server name (with or without  
>> the
>> port) as $input got this error:
>>
>> PHP Fatal error:  Call to a member function writeMessageBegin() on a
>> non-object in
>> /home/simon/PROG/PHP/UTILITY/trunk/facebook/simonsays/SimonSays.php  
>> on line
>> 47
>


Mime
View raw message