protected void FlushWait()
{
Receive<IsIdle>(idle => { }); // Do not reply, we will Terminate soon, which will do the inbound connection unstashing
Receive<Terminated>(terminated =>
{
//Clear buffer to prevent sending system messages to dead letters -- at this point we are shutting down and
//don't know if they were properly delivered or not
_resendBuffer = new AckedSendBuffer<EndpointManager.Send>(0);
Context.Stop(Self);
});
ReceiveAny(o => { }); // ignore
}