thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noam Wolf <noam.w...@gmail.com>
Subject Re: about optinal field
Date Mon, 10 May 2010 14:28:10 GMT
Can you provide more code of how you're actually passing the response back
to the client?

On Mon, May 10, 2010 at 10:24 AM, Bryan Duxbury <bryan@rapleaf.com> wrote:

> What language are your clients and servers?
>
> On Mon, May 10, 2010 at 6:41 AM, thrift thrift <thriftuser@gmail.com>
> wrote:
>
> > Hi,
> >      I met a weard problem like below.
> >
> > I have two struct
> >
> > struct ReverseRequest {
> >   1: string text,
> >   2: optional i32 int_value,
> > }
> > struct ReverseResponse {
> >   1: string reversed_text,
> >   2: optional i32 reversed_int_value,
> > }
> >
> > In client side, it set like
> >
> >    ReverseRequest reverseRequest;
> >    reverseRequest.text = "test";
> >    reverseRequest.int_value = 50;
> >
> > and
> > When I tried to get response from client
> > I used
> > ReverseResponse reverseResponse;
> > reverseResponse.reversed_int_value;
> >
> > The thing is that if I use optional keyword, then response will be 0, if
> > not, the response is 50. But even when I use optional, I also set the
> > int_value and reversed_int_value. Why 0 is returned?
> >
>



-- 
Best Regards,
Noam Wolf

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