mirror of
https://gitee.com/dgiiot/dgiot.git
synced 2024-12-02 12:18:30 +08:00
feat: add c# example
This commit is contained in:
parent
00a989d8c8
commit
7f911451a2
@ -65,3 +65,22 @@ Dlink RunTime Third-party Decode/Encode
|
||||
| | | | |
|
||||
+========================+ +========+==========+
|
||||
```
|
||||
### gRPC
|
||||
|
||||
For instructions on how to use the language-specific gRPC runtime for a project,
|
||||
please refer to these documents
|
||||
|
||||
- [C++](https://github.com/fastdgiot/grpc/tree/master/src/cpp): follow the instructions under the `src/cpp` directory
|
||||
- [C#](https://github.com/fastdgiot/grpc/tree/master/src/csharp): NuGet package `Grpc`
|
||||
- [Dart](https://github.com/grpc/grpc-dart): pub package `grpc`
|
||||
- [Go](https://github.com/grpc/grpc-go): `go get google.golang.org/grpc`
|
||||
- [Java](https://github.com/grpc/grpc-java): Use JARs from Maven Central
|
||||
Repository
|
||||
- [Kotlin](https://github.com/grpc/grpc-kotlin): Use JARs from Maven Central
|
||||
Repository
|
||||
- [Node](https://github.com/grpc/grpc-node): `npm install grpc`
|
||||
- [Objective-C](https://github.com/fastdgiot/grpc/tree/master/src/objective-c): Add `gRPC-ProtoRPC` dependency to podspec
|
||||
- [PHP](https://github.com/fastdgiot/grpc/tree/master/src/php): `pecl install grpc`
|
||||
- [Python](https://github.com/fastdgiot/grpc/tree/master/src/python/grpcio): `pip install grpcio`
|
||||
- [Ruby](https://github.com/fastdgiot/grpc/tree/master/src/ruby): `gem install grpc`
|
||||
- [WebJS](https://github.com/grpc/grpc-web): follow the grpc-web instructions
|
||||
|
@ -4,14 +4,14 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "io.grpc.examples.helloworld";
|
||||
option java_outer_classname = "HelloWorldProto";
|
||||
option objc_class_prefix = "HLW";
|
||||
option java_package = "io.grpc.examples.dlink";
|
||||
option java_outer_classname = "DlinkProto";
|
||||
option objc_class_prefix = "dlink";
|
||||
|
||||
package dgiot;
|
||||
|
||||
// The greeting service definition.
|
||||
service Greeter {
|
||||
// The dlink service definition.
|
||||
service Dlink {
|
||||
// Sends a greeting
|
||||
rpc SayHello (HelloRequest) returns (HelloReply) {}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
start() ->
|
||||
Services = #{protos => [dgiot_dlink_pb],
|
||||
services => #{'Greeter' => dgiot_greeter_svr}
|
||||
services => #{'Dlink' => dgiot_dlink_server}
|
||||
},
|
||||
{ok, _} = grpc:start_server(server, 30051, Services, []).
|
||||
|
||||
@ -36,5 +36,5 @@ logout() ->
|
||||
_ = grpc_client_sup:stop_channel_pool(channel).
|
||||
|
||||
send() ->
|
||||
dgiot_greeter_client:say_hello(#{name => <<"Xiao Ming">>}, #{channel => channel}).
|
||||
dgiot_dlink_client:say_hello(#{name => <<"Xiao Ming">>}, #{channel => channel}).
|
||||
|
||||
|
@ -14,9 +14,9 @@
|
||||
%% limitations under the License.
|
||||
%%--------------------------------------------------------------------
|
||||
|
||||
-module(dgiot_greeter_svr).
|
||||
-module(dgiot_dlink_server).
|
||||
|
||||
-behavior(dgiot_greeter_bhvr).
|
||||
-behavior(dgiot_dlink_bhvr).
|
||||
|
||||
-compile(export_all).
|
||||
-compile(nowarn_export_all).
|
Loading…
Reference in New Issue
Block a user