Re: [protobuf] Service can only receive one argument

2010-08-24 Thread Kenton Varda
message Object1And2 {
  required Object1 object1 = 1;
  required Object2 object2 = 2;
}

service MyService {
  rpc send(Object1And2) returns(VOID);
}

On Sun, Aug 22, 2010 at 1:36 AM, omer.c  wrote:

> Hello,
>
> Can a service receive multiplate arugments or only one?
>
> For example,
>
> message VOID {}
>
> message Object1
> {
>required int32 t = 1;
>required int32 s = 2;
> }
>
> message Object2
> {
>required int32 t2 = 1;
>required int32 s2 = 2;
> }
>
> How can I define a service which will accept both arguments:
>
> service my_service
> {
>  rpc send(Object1, Object2) returns(VOID);   // doesn't compile
> }
>
> Is it possible ?
>
> Thanks,
> Omer
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Service can only receive one argument

2010-08-22 Thread Evan Jones

On Aug 22, 2010, at 4:36 , omer.c wrote:

Can a service receive multiplate arugments or only one?


Only one.



How can I define a service which will accept both arguments:


Create a union message, or define two RPCs. Unions:

http://code.google.com/apis/protocolbuffers/docs/techniques.html#union

Two RPCs:

service Service {
  rpc sendObject1(Object1) returns (Result1);
  rpc sendObject2(Object2) returns (Result2);
}

Hope this helps,

Evan

--
Evan Jones
http://evanjones.ca/

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.