server monitor
This commit is contained in:
+12
-6
@@ -100,9 +100,10 @@ struct ServerGPR : public ServerOp
|
||||
auto self(it->second);
|
||||
conn->opByIOID.erase(it);
|
||||
|
||||
conn->iface->server->acceptor_loop.dispatch([self](){
|
||||
self->onClose("");
|
||||
});
|
||||
if(self->onClose)
|
||||
conn->iface->server->acceptor_loop.dispatch([self](){
|
||||
self->onClose("");
|
||||
});
|
||||
|
||||
} else {
|
||||
assert(false); // really shouldn't happen
|
||||
@@ -336,15 +337,20 @@ void ServerConn::handle_GPR(pva_app_msg_t cmd)
|
||||
|
||||
} else if(chan->onOp) { // GET, PUT
|
||||
chan->onOp(std::move(ctrl));
|
||||
|
||||
} else {
|
||||
ctrl->error("Get/Put/RPC not implemented for this PV");
|
||||
}
|
||||
|
||||
} else { // EXEC, maybe Get or Put
|
||||
|
||||
std::shared_ptr<ServerGPR> op;
|
||||
auto it = opByIOID.find(ioid);
|
||||
if(it==opByIOID.end() || !(op=std::dynamic_pointer_cast<ServerGPR>(it->second))) {
|
||||
log_printf(connio, Err, "Client %s Gets %s IOID %u\n", peerName.c_str(),
|
||||
it==opByIOID.end() ? "non-existant" : "invalid", unsigned(ioid));
|
||||
if(it==opByIOID.end() || !(op=std::dynamic_pointer_cast<ServerGPR>(it->second))
|
||||
|| op->state==ServerOp::Dead || op->state==ServerOp::Creating) {
|
||||
log_printf(connio, Err, "Client %s Gets %s IOID %u state=%d\n", peerName.c_str(),
|
||||
it==opByIOID.end() ? "non-existant" : "invalid", unsigned(ioid),
|
||||
op ? op->state : ServerOp::Dead);
|
||||
bev.reset();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user