There is a similar conversation in https://github.com/grpc/grpc/issues/23714 with more context -- is this the same issue?
On Thursday, August 6, 2020 at 10:11:34 PM UTC-7 [email protected] wrote: > My code is as simple as below: > > std::string serverAddr = > qaic::qmonInetAll + ":" + std::to_string(config.port); > > GRPCService service; > MonitorService::Service *monitorService = &service; > ServiceExt::Service *monitorExtService = &service; > > service.init(); > > ServerBuilder builder; > builder.AddListeningPort(serverAddr, grpc::InsecureServerCredentials()); > > notification_queue_ = builder.AddCompletionQueue(); > client_queue_ = builder.AddCompletionQueue(); > > builder.RegisterService(monitorService); > builder.RegisterService(monitorExtService); > builder.RegisterService(&monitorAsyncService_); > > server_ = builder.BuildAndStart(); > LogInfoG("Server listening on {}", serverAddr); > > // Queue a connect wait request > initClientSink(); > > // start 2 threads for receiving messages. > clientConnectThread_ = > std::thread(&QMonitorTaskStarter::startClientConnectThread, this); > notificationThread_ = > std::thread(&QMonitorTaskStarter::startNotificationThread, this); > if (asyncTestSupport) { > type2MsgGenThread_ = > std::thread(&QMonitorTaskStarter::genType2Messages, this); > } > > readyStatus.set_value(QS_SUCCESS); > > server_->Wait(); > // Kill threads and wait for them to exit > notification_queue_->Shutdown(); > client_queue_->Shutdown(); > // The threads should exit once a trycancel is called > // on every client > clientConnectThread_.join(); > notificationThread_.join(); > > > Let me know if I code is correct. > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/d88f583c-a2e9-4a75-b8cc-f169f5ed6f2dn%40googlegroups.com.
