diff --git a/src/amqp_channel.cpp b/src/amqp_channel.cpp index 0e98a72..7d896c0 100644 --- a/src/amqp_channel.cpp +++ b/src/amqp_channel.cpp @@ -195,12 +195,11 @@ void ChannelPrivate::close(const Frame::Method &frame) qAmqpDebug(">> class-id: %d", classId); qAmqpDebug(">> method-id: %d", methodId); Q_EMIT q->closed(); -} -void ChannelPrivate::closeOk() -{ - Frame::Method frame(Frame::fcChannel, miCloseOk); - sendFrame(frame); + // complete handshake + Frame::Method closeOkFrame(Frame::fcChannel, miCloseOk); + closeOkFrame.setChannel(channelNumber); + sendFrame(closeOkFrame); } void ChannelPrivate::closeOk(const Frame::Method &) diff --git a/src/amqp_channel_p.h b/src/amqp_channel_p.h index 55ff08d..d3469c9 100644 --- a/src/amqp_channel_p.h +++ b/src/amqp_channel_p.h @@ -46,7 +46,6 @@ public: void flow(bool active); void flowOk(); void close(int code, const QString &text, int classId, int methodId); - void closeOk(); // reimp MethodHandler virtual bool _q_method(const Frame::Method &frame); diff --git a/src/amqp_client.cpp b/src/amqp_client.cpp index 901125e..c11027b 100644 --- a/src/amqp_client.cpp +++ b/src/amqp_client.cpp @@ -447,6 +447,10 @@ void ClientPrivate::close(const Frame::Method &frame) qAmqpDebug(">> method-id: %d", methodId); connected = false; Q_EMIT q->disconnected(); + + // complete handshake + Frame::Method closeOkFrame(Frame::fcConnection, ClientPrivate::miCloseOk); + sendFrame(closeOkFrame); } void ClientPrivate::startOk() @@ -517,13 +521,6 @@ void ClientPrivate::close(int code, const QString &text, int classId, int method sendFrame(frame); } -void ClientPrivate::closeOk() -{ - Frame::Method frame(Frame::fcConnection, ClientPrivate::miCloseOk); - connected = false; - sendFrame(frame); -} - ////////////////////////////////////////////////////////////////////////// Client::Client(QObject *parent) diff --git a/src/amqp_client_p.h b/src/amqp_client_p.h index c289d08..4f900ef 100644 --- a/src/amqp_client_p.h +++ b/src/amqp_client_p.h @@ -75,7 +75,6 @@ public: // method handlers, BOTH ways void close(int code, const QString &text, int classId = 0, int methodId = 0); void close(const Frame::Method &frame); - void closeOk(); quint16 port; QString host;