如何解决python grpc客户端问题
我将新的grpc端点添加到我的c#服务器(https:// localhost:5008)。 注意:restApi和grpc端点都同时存在。 我可以在C#客户端正常的情况下连接到新的grpc端点
但是,当我尝试连接python客户端(来自Jupyter笔记本)时: 我收到下面的错误。 我正在关注这个简单的问候世界示例:https://grpc.io/docs/languages/python/quickstart/
客户代码:
import greeter_pb2
import greeter_pb2_grpc
channel = grpc.insecure_channel("localhost:5008")
stub = greeter_pb2_grpc.GreeterStub(channel)
response = stub.SayHello(greeter_pb2.HelloRequest(name='you'))
_InactiveRpcError Traceback (most recent call last)
<ipython-input-328-4bce59c8289f> in <module>()
----> 1 response = stub.SayHello(greeter_pb2.HelloRequest(name='you'))
d:\virtualenvs\dev\lib\site-packages\grpc\_channel.pyc in __call__(self,request,timeout,metadata,credentials,wait_for_ready,compression)
822 state,call,= self._blocking(request,823 wait_for_ready,compression)
--> 824 return _end_unary_response_blocking(state,False,None)
825
826 def with_call(self,d:\virtualenvs\dev\lib\site-packages\grpc\_channel.pyc in _end_unary_response_blocking(state,with_call,deadline)
724 return state.response
725 else:
--> 726 raise _InactiveRpcError(state)
727
728
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Stream removed"
debug_error_string = "{"created":"@1600681370.570000000","description":"Error received from peer ipv6:[::1]:5008","file":"src/core/lib/surface/call.cc","file_line":1056,"grpc_message":"Stream removed","grpc_status":2}"
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。