server missing channel onClose
This commit is contained in:
@@ -135,6 +135,9 @@ void ServerChannel_shutdown(const std::shared_ptr<ServerChan>& chan)
|
||||
}
|
||||
|
||||
chan->opByIOID.clear();
|
||||
|
||||
if(chan->onClose)
|
||||
chan->onClose("");
|
||||
}
|
||||
|
||||
void ServerChannelControl::close()
|
||||
|
||||
+7
-4
@@ -101,22 +101,25 @@ struct Tester {
|
||||
testShow()<<__func__;
|
||||
|
||||
std::atomic<bool> onFC{false}, onLD{false};
|
||||
epicsEvent done;
|
||||
|
||||
mbox.onFirstConnect([this, &onFC](){
|
||||
testShow()<<__func__;
|
||||
testShow()<<"In onFirstConnect()";
|
||||
|
||||
mbox.open(initial);
|
||||
onFC.store(true);
|
||||
});
|
||||
mbox.onLastDisconnect([this, &onLD](){
|
||||
testShow()<<__func__;
|
||||
mbox.onLastDisconnect([this, &onLD, &done](){
|
||||
testShow()<<"In onLastDisconnect";
|
||||
mbox.close();
|
||||
onLD.store(true);
|
||||
done.signal();
|
||||
});
|
||||
|
||||
serv.start();
|
||||
|
||||
testWait();
|
||||
testOk1(done.wait(5.0));
|
||||
|
||||
serv.stop();
|
||||
|
||||
@@ -239,7 +242,7 @@ void testError(bool phase)
|
||||
|
||||
MAIN(testget)
|
||||
{
|
||||
testPlan(14);
|
||||
testPlan(15);
|
||||
logger_config_env();
|
||||
Tester().testWaiter();
|
||||
Tester().loopback();
|
||||
|
||||
+7
-4
@@ -77,22 +77,25 @@ struct Tester {
|
||||
testShow()<<__func__;
|
||||
|
||||
std::atomic<bool> onFC{false}, onLD{false};
|
||||
epicsEvent done;
|
||||
|
||||
mbox.onFirstConnect([this, &onFC](){
|
||||
testShow()<<__func__;
|
||||
testShow()<<"In onFirstConnect()";
|
||||
|
||||
mbox.open(initial);
|
||||
onFC.store(true);
|
||||
});
|
||||
mbox.onLastDisconnect([this, &onLD](){
|
||||
testShow()<<__func__;
|
||||
mbox.onLastDisconnect([this, &onLD, &done](){
|
||||
testShow()<<"In onLastDisconnect";
|
||||
mbox.close();
|
||||
onLD.store(true);
|
||||
done.signal();
|
||||
});
|
||||
|
||||
serv.start();
|
||||
|
||||
testWait();
|
||||
testOk1(done.wait(5.0));
|
||||
|
||||
serv.stop();
|
||||
|
||||
@@ -200,7 +203,7 @@ void testError()
|
||||
|
||||
MAIN(testinfo)
|
||||
{
|
||||
testPlan(11);
|
||||
testPlan(12);
|
||||
logger_config_env();
|
||||
Tester().loopback();
|
||||
Tester().lazy();
|
||||
|
||||
+7
-4
@@ -102,22 +102,25 @@ struct Tester : public TesterBase
|
||||
testShow()<<__func__;
|
||||
|
||||
std::atomic<bool> onFC{false}, onLD{false};
|
||||
epicsEvent done;
|
||||
|
||||
mbox.onFirstConnect([this, &onFC](){
|
||||
testShow()<<__func__;
|
||||
testShow()<<"In onFirstConnect()";
|
||||
|
||||
mbox.open(initial);
|
||||
onFC.store(true);
|
||||
});
|
||||
mbox.onLastDisconnect([this, &onLD](){
|
||||
testShow()<<__func__;
|
||||
mbox.onLastDisconnect([this, &onLD, &done](){
|
||||
testShow()<<"In onLastDisconnect";
|
||||
mbox.close();
|
||||
onLD.store(true);
|
||||
done.signal();
|
||||
});
|
||||
|
||||
serv.start();
|
||||
|
||||
testWait(false);
|
||||
testOk1(done.wait(5.0));
|
||||
|
||||
serv.stop();
|
||||
|
||||
@@ -312,7 +315,7 @@ void testError()
|
||||
|
||||
MAIN(testput)
|
||||
{
|
||||
testPlan(25);
|
||||
testPlan(26);
|
||||
logger_config_env();
|
||||
Tester().loopback(false);
|
||||
Tester().loopback(true);
|
||||
|
||||
Reference in New Issue
Block a user