1 // Copyright 2020 The Pigweed Authors
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 // use this file except in compliance with the License. You may obtain a copy of
7 // https://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 // License for the specific language governing permissions and limitations under
16 package pw.rpc.internal;
18 option java_package = "dev.pigweed.pw.rpc.internal";
21 // To simplify identifying the origin of a packet, client-to-server packets
22 // use even numbers and server-to-client packets use odd numbers.
24 // Client-to-server packets
26 // A request from a client for a service method.
29 // A client stream has completed.
30 CLIENT_STREAM_END = 2;
32 // The client received a packet for an RPC it did not request.
35 // The client requests cancellation of an ongoing server stream.
36 CANCEL_SERVER_STREAM = 6;
38 // Server-to-client packets
40 // A response from a server for a service method.
43 // A server streaming or bidirectional RPC has completed.
44 SERVER_STREAM_END = 3;
46 // The server was unable to process a request.
51 // The type of packet. Determines which other fields are used.
54 // Channel through which the packet is sent.
55 uint32 channel_id = 2;
57 // Hash of the fully-qualified name of the service with which this packet is
58 // associated. For RPC packets, this is the service that processes the packet.
59 fixed32 service_id = 3;
61 // Hash of the name of the method which should process this packet.
62 fixed32 method_id = 4;
64 // The packet's payload, which is an encoded protobuf.
67 // Status code for the RPC response or error.