When can I start sending request?

47 views
Skip to first unread message

Manu

unread,
Dec 18, 2017, 2:50:09 AM12/18/17
to grpc.io
Hi,

I have a C++ server and a node.js client. I've observed that sometime my node.js client is reporting a connection failure although the server is running. This makes me wonder if my server is really ready to accept incoming requests.

Here is how I do this:
1 - Start node.js client
2 - Spawn a C++ server
3 - Wait for server to call `BuildAndStart` to provide the gRPC port to the node.js client
4 - At the same time: the C++ code calls `Wait` and the node.js client initializes its gRPC connection and sends his first request

Is this a safe scenario? If not, how long should I wait until I can send the first request?

Thanks,
Manu

Michael Lumish

unread,
Apr 2, 2018, 4:10:38 PM4/2/18
to grpc.io
You can start sending requests as soon as you initialize the client. Nothing will actually be sent over the network until the connection is properly established.
Reply all
Reply to author
Forward
0 new messages