| // Copyright 2020 The Fuchsia Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style license that can be | |
| // found in the LICENSE file. | |
| @available(added=27) | |
| library fuchsia.examples; | |
| // [START max] | |
| const MAX_STRING_LENGTH uint64 = 32; | |
| // [END max] | |
| // [START echo] | |
| @discoverable | |
| closed protocol Echo { | |
| strict EchoString(struct { | |
| value string:MAX_STRING_LENGTH; | |
| }) -> (struct { | |
| response string:MAX_STRING_LENGTH; | |
| }); | |
| strict SendString(struct { | |
| value string:MAX_STRING_LENGTH; | |
| }); | |
| strict -> OnString(struct { | |
| response string:MAX_STRING_LENGTH; | |
| }); | |
| }; | |
| // [END echo] | |
| // [START launcher] | |
| @discoverable | |
| closed protocol EchoLauncher { | |
| strict GetEcho(struct { | |
| echo_prefix string:MAX_STRING_LENGTH; | |
| }) -> (resource struct { | |
| response client_end:Echo; | |
| }); | |
| strict GetEchoPipelined(resource struct { | |
| echo_prefix string:MAX_STRING_LENGTH; | |
| request server_end:Echo; | |
| }); | |
| }; | |
| // [END launcher] | |
| service EchoService { | |
| regular_echo client_end:Echo; | |
| reversed_echo client_end:Echo; | |
| }; |