Open mw66 opened 4 years ago
It seems the handshake failed with Python server. It's so sad that we have not tested this with Python.
@Heromyth Thanks for the confirmation.
Hi, I created this PR: Python server & client for test with D client & server
https://github.com/huntlabs/grpc-dlang/pull/16
Please try it.
Thanks.
Test D client with Python server:
$ make pyproto
then test the Python server:
$ cd source
$ python3 server.py
$ python3 client.py # in another terminal
message: "hi, Hunt"
Now test D client
$ ./client
Thanks for your PR. We will test it to find out what happened.
The other way does not work either:
$ SimpleDemo$ ./server # D server, can see the request
2020-Nov-25 20:21:23.0448696 | 70846 | trace | GreeterImpl.SayHello | request: Hunt, reply: Hello Hunt | source/GreeterImpl.d:15
$ source$ python3 client.py # python client in another terminal, but didn't get response.
We are testing this. However, nothing has been found.
We are testing this. However, nothing has been found.
Are able to let s know what software you are using. If there are differences, that might highlight an issue. It looks like it could be a mismatched socket interface
Here is the example: https://github.com/huntlabs/grpc-dlang/tree/master/examples/SimpleDemo. It's OK for the server and client in D. There are problems for the server in D and the client, or the converse. We are using a tool called Wireshark to monitor the communication, try to find out the difference.
By the way, adding some debug switchers to dub.json
, you can get more logs for debug.
"versions": [
"HUNT_DEBUG", "HUNT_HTTP_DEBUG", "HUNT_NET_DEBUG"
],
@Heromyth
Do you want to add this issue to GSOC (Google Summer of Code) projects? so someone can try to fix the network issue, and be awarded by Google?
https://github.com/dlang/projects/issues?q=is%3Aissue+is%3Aopen+label%3Agsoc2021
We need to fix this
D grpc client still has some problems, I'll investigate.
Thansk. All the patches are merged.
The client cannot finish successfully.
It seems that the problem is there's no way to stop hunt.net.NetUtil.eventLoop explicitly.
Ah, I'm wrong. This uses EventLoopPool internally.
Tried,
// Disconnect.
channel.destroy();
import hunt.http.Util;
CommonUtil.stopScheduler;
import hunt.net.EventLoopPool;
shutdownEventLoopPool;
but the client didn't stop.
Tried,
// Disconnect. channel.destroy(); import hunt.http.Util; CommonUtil.stopScheduler; import hunt.net.EventLoopPool; shutdownEventLoopPool;
but the client didn't stop.
You can use gdb to debug this, and check which thread is stopping the client from exit.
Just an update on the progress (for the new comers): right now Python client can talk to D server, thanks @kubo39 ; but the other way still does not work. People can give the demo a try:
https://github.com/huntlabs/grpc-dlang/tree/master/examples/SimpleDemo
Since D's strength is on the server side, I'd say 60% of the bug fixed :-)
Hi,
I'm trying the helloworld example, but I'm using a Python server, something like this:
And then use the D grpc client talk to it, the 1st time I run it: I got:
The 2nd time:
Since it's a very simple grpc server, before I investigate further, I want to ask: does this D library's grpc client can talk to a Python grpc server?
The Python side grpc code are generated with:
with vesion:
If you know these 2 can work together, can you provide a Python grpc server example? and with the specific Python package version?
Thanks.