QAmqpChannel: Emit closed signal when server closes.
When we initiate a Close, we get a CloseOk in response and on receipt of the CloseOk, we mark the channel as closed and emit a signal to notify everyone else. Great. Now what happens when the server closes the channel? We emit a CloseOk, then… nothing. We do nothing. This fixes this problem, moving the notification/marking logic to a new function and calling that on both Close (sent from server) and CloseOk.
This commit is contained in:
parent
568dc6770a
commit
2b707d53de
|
|
@ -203,9 +203,17 @@ void QAmqpChannelPrivate::close(const QAmqpMethodFrame &frame)
|
||||||
QAmqpMethodFrame closeOkFrame(QAmqpFrame::Channel, miCloseOk);
|
QAmqpMethodFrame closeOkFrame(QAmqpFrame::Channel, miCloseOk);
|
||||||
closeOkFrame.setChannel(channelNumber);
|
closeOkFrame.setChannel(channelNumber);
|
||||||
sendFrame(closeOkFrame);
|
sendFrame(closeOkFrame);
|
||||||
|
|
||||||
|
// notify everyone that the channel was closed on us.
|
||||||
|
notifyClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QAmqpChannelPrivate::closeOk(const QAmqpMethodFrame &)
|
void QAmqpChannelPrivate::closeOk(const QAmqpMethodFrame &)
|
||||||
|
{
|
||||||
|
notifyClosed();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QAmqpChannelPrivate::notifyClosed()
|
||||||
{
|
{
|
||||||
Q_Q(QAmqpChannel);
|
Q_Q(QAmqpChannel);
|
||||||
Q_EMIT q->closed();
|
Q_EMIT q->closed();
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ public:
|
||||||
void flow(bool active);
|
void flow(bool active);
|
||||||
void flowOk();
|
void flowOk();
|
||||||
void close(int code, const QString &text, int classId, int methodId);
|
void close(int code, const QString &text, int classId, int methodId);
|
||||||
|
void notifyClosed();
|
||||||
|
|
||||||
// reimp MethodHandler
|
// reimp MethodHandler
|
||||||
virtual bool _q_method(const QAmqpMethodFrame &frame);
|
virtual bool _q_method(const QAmqpMethodFrame &frame);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue