We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
流程: 1)client_1 发送服务端流式调用请求; 2)server 端接收流式请求,并开启线程发送流数据; 3)client_1 接收流数据; 4)client_2 发送单次请求,服务端未进行响应;
问题: 目前还没有定位到是不是我的程序错误,所以先问一下目前的grpc-c版本是否支持并发请求? 有时间帮忙解答一下,多谢!
The text was updated successfully, but these errors were encountered:
server端代码参考foo_server示例,仅在中间增加了流处理的线程。
int dp_grpc_server() { CONFIG * cfg = NULL; s8 ip_str[50] = {0};
cfg = config_load(CONPLAT_CONF"/grpc_server_conf.conf"); snprintf(ip_str,50,"%s:%s",config_get(cfg, "grpc_server_ip", "127.0.0.1"),config_get(cfg, "grpc_server_port", "50000")); config_free(cfg); /* * Initialize grpc-c library to be used with vanilla gRPC */ DEBUG_F1("(%s,%d)%p\r\n",__FUNCTION__,__LINE__,grpc_c_init); grpc_c_init(); /* * Create server object */ DEBUG_F1("(%s,%d)\r\n",__FUNCTION__,__LINE__); test_server = grpc_c_server_create(ip_str, NULL, NULL); if (test_server == NULL) { printf("Failed to create server\n"); exit(1); } DEBUG_F1("(%s,%d)\r\n",__FUNCTION__,__LINE__); /* * Initialize greeter service */ grpc_service_init(test_server); DEBUG_F1("(%s,%d)\r\n",__FUNCTION__,__LINE__); /* * Start server */ grpc_c_server_start(test_server); DEBUG_F1("(%s,%d)\r\n",__FUNCTION__,__LINE__); //需要在这个位置加入服务端和流式的线程创建,并进入等待。 pthread_create(&stream_pid, NULL, grpc_server_stream_thread, NULL); /* * Blocks server to wait to completion */ DEBUG_F1("(%s,%d)stream_pid:%lu\r\n",__FUNCTION__,__LINE__,stream_pid); grpc_c_server_wait(test_server); DEBUG_F1("(%s,%d)\r\n",__FUNCTION__,__LINE__); /* * Destory server */ DEBUG_F1("(%s,%d)\r\n",__FUNCTION__,__LINE__); grpc_c_server_destroy(test_server); /* * Destory grpc-c library. */ DEBUG_F1("(%s,%d)\r\n",__FUNCTION__,__LINE__); grpc_c_shutdown(); return 0;
}
Sorry, something went wrong.
No branches or pull requests
流程:
1)client_1 发送服务端流式调用请求;
2)server 端接收流式请求,并开启线程发送流数据;
3)client_1 接收流数据;
4)client_2 发送单次请求,服务端未进行响应;
问题:
目前还没有定位到是不是我的程序错误,所以先问一下目前的grpc-c版本是否支持并发请求?
有时间帮忙解答一下,多谢!
The text was updated successfully, but these errors were encountered: