E0805 15:05:07.514000000 4924 chttp2_transport.c:1810] close_transport: {"created":"@1470423907.514000000","description":"End of TCP stream","file":"c:\main\extlibs\gr\src\core\lib\iomgr\tcp_windows.c","file_line":179}
message not available
421 Service not available
This clearly shows that the client and server are communicating the grpc::StatusCode::UNAVAILABLE, however I do not want the extra tcp_windows.c crap to appear.
My question is, how should I handle cases where an rpc method needs to return an error code instead of filling in the response message buffer. Do I always need to fill the response buffer details in? Also on the client side do I need to do anything special to close the channel?
message OpSupportResponse {
RXMessageType message_type = 1;
string datetime = 20;
}
service CAService {
// rpc method to retrieve current OpSupportMessage
rpc GetOpSupportMessage (google.protobuf.Empty) returns (OpSupportResponse) {}
}
grpc::Status
CADaemon::GetOpSupportMessage(
ServerContext* context,
const::google::protobuf::Empty* request,
ca::OpSupportResponse* response)
{
if (mpOpSupportMessage) {
response->set_message_type(ca::RXMessageType::OPERATIONAL_SUPPORT);
response->set_datetime(value);
return grpc::Status::OK;
} else { // still waiting for the message
// return grpc::Status::OK;
return grpc::Status(grpc::StatusCode::UNAVAILABLE,
"message not available");
}
}