A Node.js implementation of the protocol used by GrpcDotNetNamedPipes
Note: This is not an official gRPC implementation. Its mainly designed to work with GrpcDotNetNamedPipes for scenarios involving inter-process communication between .NET and Node.js over Named Pipes.
- [x] NodeJs Server Implementation
- [x] Unary
- [x] Server Streaming
- [ ] Client Streaming
- [ ] Bidirectional Streaming
- [ ] NodeJs Client Implementation
- [ ] Unary
- [ ] Server Streaming
- [ ] Client Streaming
- [ ] Bidirectional Streaming
/**
* service implementation
*/
function sayHello(call, callback) {
var reply = new greeterMessages.HelloReply();
reply.setMessage('Hello ' + call.request.getName());
callback(null, reply);
}
var namedPipeServer = new NamedPipeServer("MY_NAMED_PIPE");
namedPipeServer.addService(greeterServices.GreeterService, { sayHello: sayHello })
namedPipeServer.start((error) => {
if (error === undefined) {
console.log("server listening")
}
})
(see GrpcDotNetNamedPipes)
var channel = new GrpcDotNetNamedPipes.NamedPipeChannel(".", "MY_NAMED_PIPE");
var client = new Greeter.GreeterClient(channel);
var response = await client.SayHelloAsync(new HelloRequest { Name = "World" });
Console.WriteLine(response.Message); //prints "Hello World"