Problem about examples
Closed this issue · 5 comments
I am trying to run examples/foo on my Linux Env(ubuntu-18.04.2-desktop-amd64), but it seems that connections (client - server) can be established, but data cannot be transmitted properly .
No debugging information is printed. More details:
root@ubuntu:/home/workspace/grpc-c/examples/bin# ps afx | grep foo
4018 pts/3 Sl 0:00 | _ ./foo_bin server
4759 pts/3 Sl 0:00 | _ ./foo_bin client
root@ubuntu:/home/workspace/grpc-c/examples/bin# netstat -an | grep 3000
tcp6 0 0 127.0.0.1:3000 :::* LISTEN
tcp6 0 0 127.0.0.1:3000 127.0.0.1:52926 ESTABLISHED
tcp6 0 0 127.0.0.1:52926 127.0.0.1:3000 ESTABLISHED
Is this a known problem?
is not problem,default do not output any log,you can modify example code
for debugging.
Thanks for reply!But I am afraid maybe it’s not about debugging info output.
I add some new debugging information in foo_server (example/foo/foo_server.c),as follow:
printf("\nEnter foo_server\n");
Then run the process:
root@ubuntu:/home/workspace/grpc-c/examples# ./bin/foo_bin server &
Enter foo_server
root@ubuntu:/home/workspace/grpc-c/examples# ./bin/foo_bin client &
root@ubuntu:/home/workspace/grpc-c/examples# [grpc-c]I client.c:189 client connect status is 0
[grpc-c]I client.c:189 client connect status is 2
root@ubuntu:/home/workspace/grpc-c/examples#
It seems that client is block at status 2, and TCP connection is OK, but rpc process can't work.
Any more suggestions to locate the problem?
default print the number requests, Then foo_bin client process exit!
root@ubuntu:~/grpc-c/examples# ./bin/foo_bin client
Total Count 10000
Total Count 10000
Total Count 10000
Total Count 10000
Please check third-party library versions in the environment! or building under new ubuntu linux environment.
Thanks for help. I have solved the problem. It's about thread pool creation:
In my virtual environment, num of cpu core = 1. After I set it to 4, the example program runs well.