OK, Sorry...
Firstly sorry about my English...
I have a project made in C that use protobuf-c-rpc to create a RPC
procedures, that interfaces with others application in C normally.
Now I need to do an application in NodeJs that uses the same interface, I
tried by using protobuf-rpc:
<CODE>
var express = require('express');
var app = express();
var ProtoBuf = require('protobufjs');
ProtoBuf.Rpc = require('protobuf-rpc');
var builder = ProtoBuf.loadProtoFile("ControllerMessage.proto");
var My_controller = builder.build('MyPackage');
var controller_svc = new ProtoBuf.Rpc(My_controller.Controller, {
transport: new ProtoBuf.Rpc.Transport.Xhr( {sync: true} ),
url: 'http://127.0.0.1:5558'
});
app.get('/have_pswd', function (req, res) {
var serv_req = new My_controller.Void();
controller_svc.HavePassword(serv_req, function(error, serv_res) {
if (error !== null)
return res.status(500).send('error');
res.json(serv_res);
});
});
var server = app.listen(9017, function(){
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
</CODE>
When I send a GET to localhost:9017/have_pswd, I have a error(500).
After that I tried by using grpc++:
protoc --proto_path=. --grpc_out=. --plugin=protoc-gen-grpc=`which
grpc_cpp_plugin` ControllerMessage.proto
protoc --proto_path=. --cpp_out=. ControllerMessage.proto
<CODE>
#include <grpc++/grpc++.h>
#include "ControllerMessage.pb.h"
#include "ControllerMessage.grpc.pb.h"
int main (int argc, char* argv[])
{
std::unique_ptr<MyPackage::Controller::Stub>
stub(MyPackage::Controller::NewStub(
grpc::CreateChannel("localhost:5558",
grpc::InsecureChannelCredentials())));
grpc::ClientContext cxt;
MyPackage::Void req;
MyPackage::Boolean res;
stub->HavePassword(&cxt, req, &res);
}
</CODE>
And on debug the line "stub->HavePassword(&cxt, req, &res);" make me wait
forever.
I would like to know what I did wrong...
Thanks...
On Wed, Aug 17, 2016 at 10:51 AM, Nathaniel Manista <[email protected]>
wrote:
> On Wed, Aug 17, 2016 at 6:13 AM, <[email protected]> wrote:
>
>> I worked in a project that implemented a protocol buffers RPC in C using
>> protobuf-c-rpc and now I'm trying develop a C++ or NodeJs client using grpc
>> but it not working.
>>
>
> How much more can you share with us about what's not working
> <http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>?
> -Nathaniel
>
--
--
echo Gur orfg jnl gb cerqvpg gur shgher vf gb vairag vg: -- Nyna Xnl | tr
N-ZA-Mn-za-m: A-Za-z.
Kabloc Vacavoa
google.com/profiles/kabloc
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/CAMFKE38HWbz5_9NQXvR7t6oEzTFBDdi_uY9py1S5f9Q%3D0_qaWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.