clean up QAmqpFrame paths
- opt for QDataStream overloads instead of read ctor and toStream methods - removed some unneccesary prefixes to Type and MethodClass enums - removed documentation from header (this is coming back!) - cleaned up some confusing code paths, removed unneccessary methods (like readHeader/writeHeader)
This commit is contained in:
parent
10ab1423c2
commit
7242a64a2f
|
|
@ -38,7 +38,7 @@ bool QAmqpChannelPrivate::_q_method(const QAmqpMethodFrame &frame)
|
||||||
if (frame.channel() != channelNumber)
|
if (frame.channel() != channelNumber)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (frame.methodClass() == QAmqpFrame::fcBasic) {
|
if (frame.methodClass() == QAmqpFrame::Basic) {
|
||||||
if (frame.id() == bmQosOk) {
|
if (frame.id() == bmQosOk) {
|
||||||
qosOk(frame);
|
qosOk(frame);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -47,7 +47,7 @@ bool QAmqpChannelPrivate::_q_method(const QAmqpMethodFrame &frame)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame.methodClass() != QAmqpFrame::fcChannel)
|
if (frame.methodClass() != QAmqpFrame::Channel)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
qAmqpDebug("Channel#%d:", channelNumber);
|
qAmqpDebug("Channel#%d:", channelNumber);
|
||||||
|
|
@ -97,7 +97,7 @@ void QAmqpChannelPrivate::open()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
qAmqpDebug("Open channel #%d", channelNumber);
|
qAmqpDebug("Open channel #%d", channelNumber);
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcChannel, miOpen);
|
QAmqpMethodFrame frame(QAmqpFrame::Channel, miOpen);
|
||||||
frame.setChannel(channelNumber);
|
frame.setChannel(channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
@ -114,7 +114,7 @@ void QAmqpChannelPrivate::flow(bool active)
|
||||||
QDataStream stream(&arguments, QIODevice::WriteOnly);
|
QDataStream stream(&arguments, QIODevice::WriteOnly);
|
||||||
QAmqpFrame::writeAmqpField(stream, QAmqpMetaType::ShortShortUint, (active ? 1 : 0));
|
QAmqpFrame::writeAmqpField(stream, QAmqpMetaType::ShortShortUint, (active ? 1 : 0));
|
||||||
|
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcChannel, miFlow);
|
QAmqpMethodFrame frame(QAmqpFrame::Channel, miFlow);
|
||||||
frame.setChannel(channelNumber);
|
frame.setChannel(channelNumber);
|
||||||
frame.setArguments(arguments);
|
frame.setArguments(arguments);
|
||||||
sendFrame(frame);
|
sendFrame(frame);
|
||||||
|
|
@ -162,7 +162,7 @@ void QAmqpChannelPrivate::close(int code, const QString &text, int classId, int
|
||||||
QAmqpFrame::writeAmqpField(stream, QAmqpMetaType::ShortUint, classId);
|
QAmqpFrame::writeAmqpField(stream, QAmqpMetaType::ShortUint, classId);
|
||||||
QAmqpFrame::writeAmqpField(stream, QAmqpMetaType::ShortUint, methodId);
|
QAmqpFrame::writeAmqpField(stream, QAmqpMetaType::ShortUint, methodId);
|
||||||
|
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcChannel, miClose);
|
QAmqpMethodFrame frame(QAmqpFrame::Channel, miClose);
|
||||||
frame.setChannel(channelNumber);
|
frame.setChannel(channelNumber);
|
||||||
frame.setArguments(arguments);
|
frame.setArguments(arguments);
|
||||||
sendFrame(frame);
|
sendFrame(frame);
|
||||||
|
|
@ -196,7 +196,7 @@ void QAmqpChannelPrivate::close(const QAmqpMethodFrame &frame)
|
||||||
Q_EMIT q->closed();
|
Q_EMIT q->closed();
|
||||||
|
|
||||||
// complete handshake
|
// complete handshake
|
||||||
QAmqpMethodFrame closeOkFrame(QAmqpFrame::fcChannel, miCloseOk);
|
QAmqpMethodFrame closeOkFrame(QAmqpFrame::Channel, miCloseOk);
|
||||||
closeOkFrame.setChannel(channelNumber);
|
closeOkFrame.setChannel(channelNumber);
|
||||||
sendFrame(closeOkFrame);
|
sendFrame(closeOkFrame);
|
||||||
}
|
}
|
||||||
|
|
@ -289,7 +289,7 @@ bool QAmqpChannel::isOpened() const
|
||||||
void QAmqpChannel::qos(qint16 prefetchCount, qint32 prefetchSize)
|
void QAmqpChannel::qos(qint16 prefetchCount, qint32 prefetchSize)
|
||||||
{
|
{
|
||||||
Q_D(QAmqpChannel);
|
Q_D(QAmqpChannel);
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcBasic, QAmqpChannelPrivate::bmQos);
|
QAmqpMethodFrame frame(QAmqpFrame::Basic, QAmqpChannelPrivate::bmQos);
|
||||||
frame.setChannel(d->channelNumber);
|
frame.setChannel(d->channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
|
||||||
|
|
@ -207,16 +207,18 @@ void QAmqpClientPrivate::_q_readyRead()
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream streamB(&buffer, QIODevice::ReadOnly);
|
QDataStream streamB(&buffer, QIODevice::ReadOnly);
|
||||||
switch(QAmqpFrame::Type(type)) {
|
switch (static_cast<QAmqpFrame::FrameType>(type)) {
|
||||||
case QAmqpFrame::ftMethod:
|
case QAmqpFrame::Method:
|
||||||
{
|
{
|
||||||
QAmqpMethodFrame frame(streamB);
|
QAmqpMethodFrame frame;
|
||||||
|
streamB >> frame;
|
||||||
|
|
||||||
if (frame.size() > frameMax) {
|
if (frame.size() > frameMax) {
|
||||||
close(QAMQP::FrameError, "frame size too large");
|
close(QAMQP::FrameError, "frame size too large");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame.methodClass() == QAmqpFrame::fcConnection) {
|
if (frame.methodClass() == QAmqpFrame::Connection) {
|
||||||
_q_method(frame);
|
_q_method(frame);
|
||||||
} else {
|
} else {
|
||||||
foreach (QAmqpMethodFrameHandler *methodHandler, methodHandlersByChannel[frame.channel()])
|
foreach (QAmqpMethodFrameHandler *methodHandler, methodHandlersByChannel[frame.channel()])
|
||||||
|
|
@ -224,9 +226,11 @@ void QAmqpClientPrivate::_q_readyRead()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QAmqpFrame::ftHeader:
|
case QAmqpFrame::Header:
|
||||||
{
|
{
|
||||||
QAmqpContentFrame frame(streamB);
|
QAmqpContentFrame frame;
|
||||||
|
streamB >> frame;
|
||||||
|
|
||||||
if (frame.size() > frameMax) {
|
if (frame.size() > frameMax) {
|
||||||
close(QAMQP::FrameError, "frame size too large");
|
close(QAMQP::FrameError, "frame size too large");
|
||||||
return;
|
return;
|
||||||
|
|
@ -239,9 +243,11 @@ void QAmqpClientPrivate::_q_readyRead()
|
||||||
methodHandler->_q_content(frame);
|
methodHandler->_q_content(frame);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QAmqpFrame::ftBody:
|
case QAmqpFrame::Body:
|
||||||
{
|
{
|
||||||
QAmqpContentBodyFrame frame(streamB);
|
QAmqpContentBodyFrame frame;
|
||||||
|
streamB >> frame;
|
||||||
|
|
||||||
if (frame.size() > frameMax) {
|
if (frame.size() > frameMax) {
|
||||||
close(QAMQP::FrameError, "frame size too large");
|
close(QAMQP::FrameError, "frame size too large");
|
||||||
return;
|
return;
|
||||||
|
|
@ -254,9 +260,11 @@ void QAmqpClientPrivate::_q_readyRead()
|
||||||
methodHandler->_q_body(frame);
|
methodHandler->_q_body(frame);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QAmqpFrame::ftHeartbeat:
|
case QAmqpFrame::Heartbeat:
|
||||||
{
|
{
|
||||||
QAmqpMethodFrame frame(streamB);
|
QAmqpMethodFrame frame;
|
||||||
|
streamB >> frame;
|
||||||
|
|
||||||
if (frame.channel() != 0) {
|
if (frame.channel() != 0) {
|
||||||
close(QAMQP::FrameError, "heartbeat must have channel id zero");
|
close(QAMQP::FrameError, "heartbeat must have channel id zero");
|
||||||
return;
|
return;
|
||||||
|
|
@ -281,13 +289,13 @@ void QAmqpClientPrivate::sendFrame(const QAmqpFrame &frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream stream(socket);
|
QDataStream stream(socket);
|
||||||
frame.toStream(stream);
|
stream << frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QAmqpClientPrivate::_q_method(const QAmqpMethodFrame &frame)
|
bool QAmqpClientPrivate::_q_method(const QAmqpMethodFrame &frame)
|
||||||
{
|
{
|
||||||
Q_ASSERT(frame.methodClass() == QAmqpFrame::fcConnection);
|
Q_ASSERT(frame.methodClass() == QAmqpFrame::Connection);
|
||||||
if (frame.methodClass() != QAmqpFrame::fcConnection)
|
if (frame.methodClass() != QAmqpFrame::Connection)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
qAmqpDebug() << "Connection:";
|
qAmqpDebug() << "Connection:";
|
||||||
|
|
@ -448,13 +456,13 @@ void QAmqpClientPrivate::close(const QAmqpMethodFrame &frame)
|
||||||
Q_EMIT q->disconnected();
|
Q_EMIT q->disconnected();
|
||||||
|
|
||||||
// complete handshake
|
// complete handshake
|
||||||
QAmqpMethodFrame closeOkFrame(QAmqpFrame::fcConnection, QAmqpClientPrivate::miCloseOk);
|
QAmqpMethodFrame closeOkFrame(QAmqpFrame::Connection, QAmqpClientPrivate::miCloseOk);
|
||||||
sendFrame(closeOkFrame);
|
sendFrame(closeOkFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QAmqpClientPrivate::startOk()
|
void QAmqpClientPrivate::startOk()
|
||||||
{
|
{
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcConnection, QAmqpClientPrivate::miStartOk);
|
QAmqpMethodFrame frame(QAmqpFrame::Connection, QAmqpClientPrivate::miStartOk);
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
QDataStream stream(&arguments, QIODevice::WriteOnly);
|
QDataStream stream(&arguments, QIODevice::WriteOnly);
|
||||||
|
|
||||||
|
|
@ -479,7 +487,7 @@ void QAmqpClientPrivate::secureOk()
|
||||||
|
|
||||||
void QAmqpClientPrivate::tuneOk()
|
void QAmqpClientPrivate::tuneOk()
|
||||||
{
|
{
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcConnection, QAmqpClientPrivate::miTuneOk);
|
QAmqpMethodFrame frame(QAmqpFrame::Connection, QAmqpClientPrivate::miTuneOk);
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
QDataStream stream(&arguments, QIODevice::WriteOnly);
|
QDataStream stream(&arguments, QIODevice::WriteOnly);
|
||||||
|
|
||||||
|
|
@ -493,7 +501,7 @@ void QAmqpClientPrivate::tuneOk()
|
||||||
|
|
||||||
void QAmqpClientPrivate::open()
|
void QAmqpClientPrivate::open()
|
||||||
{
|
{
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcConnection, QAmqpClientPrivate::miOpen);
|
QAmqpMethodFrame frame(QAmqpFrame::Connection, QAmqpClientPrivate::miOpen);
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
QDataStream stream(&arguments, QIODevice::WriteOnly);
|
QDataStream stream(&arguments, QIODevice::WriteOnly);
|
||||||
|
|
||||||
|
|
@ -515,7 +523,7 @@ void QAmqpClientPrivate::close(int code, const QString &text, int classId, int m
|
||||||
stream << qint16(classId);
|
stream << qint16(classId);
|
||||||
stream << qint16(methodId);
|
stream << qint16(methodId);
|
||||||
|
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcConnection, QAmqpClientPrivate::miClose);
|
QAmqpMethodFrame frame(QAmqpFrame::Connection, QAmqpClientPrivate::miClose);
|
||||||
frame.setArguments(arguments);
|
frame.setArguments(arguments);
|
||||||
sendFrame(frame);
|
sendFrame(frame);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ void QAmqpExchangePrivate::declare()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcExchange, QAmqpExchangePrivate::miDeclare);
|
QAmqpMethodFrame frame(QAmqpFrame::Exchange, QAmqpExchangePrivate::miDeclare);
|
||||||
frame.setChannel(channelNumber);
|
frame.setChannel(channelNumber);
|
||||||
|
|
||||||
QByteArray args;
|
QByteArray args;
|
||||||
|
|
@ -61,7 +61,7 @@ bool QAmqpExchangePrivate::_q_method(const QAmqpMethodFrame &frame)
|
||||||
if (QAmqpChannelPrivate::_q_method(frame))
|
if (QAmqpChannelPrivate::_q_method(frame))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (frame.methodClass() == QAmqpFrame::fcExchange) {
|
if (frame.methodClass() == QAmqpFrame::Exchange) {
|
||||||
switch (frame.id()) {
|
switch (frame.id()) {
|
||||||
case miDeclareOk:
|
case miDeclareOk:
|
||||||
declareOk(frame);
|
declareOk(frame);
|
||||||
|
|
@ -76,7 +76,7 @@ bool QAmqpExchangePrivate::_q_method(const QAmqpMethodFrame &frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else if (frame.methodClass() == QAmqpFrame::fcBasic) {
|
} else if (frame.methodClass() == QAmqpFrame::Basic) {
|
||||||
switch (frame.id()) {
|
switch (frame.id()) {
|
||||||
case bmReturn:
|
case bmReturn:
|
||||||
basicReturn(frame);
|
basicReturn(frame);
|
||||||
|
|
@ -198,7 +198,7 @@ void QAmqpExchange::declare(const QString &type, ExchangeOptions options, const
|
||||||
void QAmqpExchange::remove(int options)
|
void QAmqpExchange::remove(int options)
|
||||||
{
|
{
|
||||||
Q_D(QAmqpExchange);
|
Q_D(QAmqpExchange);
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcExchange, QAmqpExchangePrivate::miDelete);
|
QAmqpMethodFrame frame(QAmqpFrame::Exchange, QAmqpExchangePrivate::miDelete);
|
||||||
frame.setChannel(d->channelNumber);
|
frame.setChannel(d->channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
@ -231,7 +231,7 @@ void QAmqpExchange::publish(const QByteArray &message, const QString &routingKey
|
||||||
const QAmqpMessage::PropertyHash &properties, int publishOptions)
|
const QAmqpMessage::PropertyHash &properties, int publishOptions)
|
||||||
{
|
{
|
||||||
Q_D(QAmqpExchange);
|
Q_D(QAmqpExchange);
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcBasic, QAmqpExchangePrivate::bmPublish);
|
QAmqpMethodFrame frame(QAmqpFrame::Basic, QAmqpExchangePrivate::bmPublish);
|
||||||
frame.setChannel(d->channelNumber);
|
frame.setChannel(d->channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
@ -245,7 +245,7 @@ void QAmqpExchange::publish(const QByteArray &message, const QString &routingKey
|
||||||
frame.setArguments(arguments);
|
frame.setArguments(arguments);
|
||||||
d->sendFrame(frame);
|
d->sendFrame(frame);
|
||||||
|
|
||||||
QAmqpContentFrame content(QAmqpFrame::fcBasic);
|
QAmqpContentFrame content(QAmqpFrame::Basic);
|
||||||
content.setChannel(d->channelNumber);
|
content.setChannel(d->channelNumber);
|
||||||
content.setProperty(QAmqpMessage::ContentType, mimeType);
|
content.setProperty(QAmqpMessage::ContentType, mimeType);
|
||||||
content.setProperty(QAmqpMessage::ContentEncoding, "utf-8");
|
content.setProperty(QAmqpMessage::ContentEncoding, "utf-8");
|
||||||
|
|
|
||||||
|
|
@ -6,21 +6,16 @@
|
||||||
#include "qamqpglobal.h"
|
#include "qamqpglobal.h"
|
||||||
#include "qamqpframe_p.h"
|
#include "qamqpframe_p.h"
|
||||||
|
|
||||||
QAmqpFrame::QAmqpFrame(Type type)
|
QAmqpFrame::QAmqpFrame(FrameType type)
|
||||||
: size_(0),
|
: size_(0),
|
||||||
type_(type),
|
type_(type),
|
||||||
channel_(0)
|
channel_(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpFrame::QAmqpFrame(QDataStream &raw)
|
QAmqpFrame::FrameType QAmqpFrame::type() const
|
||||||
{
|
{
|
||||||
readHeader(raw);
|
return static_cast<QAmqpFrame::FrameType>(type_);
|
||||||
}
|
|
||||||
|
|
||||||
QAmqpFrame::Type QAmqpFrame::type() const
|
|
||||||
{
|
|
||||||
return Type(type_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpFrame::~QAmqpFrame()
|
QAmqpFrame::~QAmqpFrame()
|
||||||
|
|
@ -42,26 +37,6 @@ qint32 QAmqpFrame::size() const
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QAmqpFrame::writeHeader(QDataStream &stream) const
|
|
||||||
{
|
|
||||||
stream << type_;
|
|
||||||
stream << channel_;
|
|
||||||
stream << qint32(size());
|
|
||||||
}
|
|
||||||
|
|
||||||
void QAmqpFrame::writeEnd(QDataStream &stream) const
|
|
||||||
{
|
|
||||||
stream << qint8(FRAME_END);
|
|
||||||
stream.device()->waitForBytesWritten(1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QAmqpFrame::readHeader(QDataStream &stream)
|
|
||||||
{
|
|
||||||
stream >> type_;
|
|
||||||
stream >> channel_;
|
|
||||||
stream >> size_;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
void QAmqpFrame::readEnd(QDataStream &stream)
|
void QAmqpFrame::readEnd(QDataStream &stream)
|
||||||
{
|
{
|
||||||
|
|
@ -72,26 +47,44 @@ void QAmqpFrame::readEnd(QDataStream &stream)
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void QAmqpFrame::toStream(QDataStream &stream) const
|
QDataStream &operator<<(QDataStream &stream, const QAmqpFrame &frame)
|
||||||
{
|
{
|
||||||
writeHeader(stream);
|
// write header
|
||||||
writePayload(stream);
|
stream << frame.type_;
|
||||||
writeEnd(stream);
|
stream << frame.channel_;
|
||||||
|
stream << frame.size();
|
||||||
|
|
||||||
|
frame.writePayload(stream);
|
||||||
|
|
||||||
|
// write end
|
||||||
|
stream << qint8(QAmqpFrame::FRAME_END);
|
||||||
|
stream.device()->waitForBytesWritten(1000);
|
||||||
|
return stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDataStream &operator>>(QDataStream &stream, QAmqpFrame &frame)
|
||||||
|
{
|
||||||
|
stream >> frame.type_;
|
||||||
|
stream >> frame.channel_;
|
||||||
|
stream >> frame.size_;
|
||||||
|
frame.readPayload(stream);
|
||||||
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
QAmqpMethodFrame::QAmqpMethodFrame(MethodClass methodClass, qint16 id)
|
QAmqpMethodFrame::QAmqpMethodFrame()
|
||||||
: QAmqpFrame(QAmqpFrame::ftMethod),
|
: QAmqpFrame(QAmqpFrame::Method),
|
||||||
methodClass_(methodClass),
|
methodClass_(0),
|
||||||
id_(id)
|
id_(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpMethodFrame::QAmqpMethodFrame(QDataStream &raw)
|
QAmqpMethodFrame::QAmqpMethodFrame(MethodClass methodClass, qint16 id)
|
||||||
: QAmqpFrame(raw)
|
: QAmqpFrame(QAmqpFrame::Method),
|
||||||
|
methodClass_(methodClass),
|
||||||
|
id_(id)
|
||||||
{
|
{
|
||||||
readPayload(raw);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpFrame::MethodClass QAmqpMethodFrame::methodClass() const
|
QAmqpFrame::MethodClass QAmqpMethodFrame::methodClass() const
|
||||||
|
|
@ -264,22 +257,16 @@ void QAmqpFrame::writeAmqpField(QDataStream &s, QAmqpMetaType::ValueType type, c
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
QAmqpContentFrame::QAmqpContentFrame()
|
QAmqpContentFrame::QAmqpContentFrame()
|
||||||
: QAmqpFrame(QAmqpFrame::ftHeader)
|
: QAmqpFrame(QAmqpFrame::Header)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpContentFrame::QAmqpContentFrame(QAmqpFrame::MethodClass methodClass)
|
QAmqpContentFrame::QAmqpContentFrame(QAmqpFrame::MethodClass methodClass)
|
||||||
: QAmqpFrame(QAmqpFrame::ftHeader)
|
: QAmqpFrame(QAmqpFrame::Header)
|
||||||
{
|
{
|
||||||
methodClass_ = methodClass;
|
methodClass_ = methodClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpContentFrame::QAmqpContentFrame(QDataStream &raw)
|
|
||||||
: QAmqpFrame(raw)
|
|
||||||
{
|
|
||||||
readPayload(raw);
|
|
||||||
}
|
|
||||||
|
|
||||||
QAmqpFrame::MethodClass QAmqpContentFrame::methodClass() const
|
QAmqpFrame::MethodClass QAmqpContentFrame::methodClass() const
|
||||||
{
|
{
|
||||||
return MethodClass(methodClass_);
|
return MethodClass(methodClass_);
|
||||||
|
|
@ -421,16 +408,10 @@ void QAmqpContentFrame::readPayload(QDataStream &in)
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
QAmqpContentBodyFrame::QAmqpContentBodyFrame()
|
QAmqpContentBodyFrame::QAmqpContentBodyFrame()
|
||||||
: QAmqpFrame(QAmqpFrame::ftBody)
|
: QAmqpFrame(QAmqpFrame::Body)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpContentBodyFrame::QAmqpContentBodyFrame(QDataStream &raw)
|
|
||||||
: QAmqpFrame(raw)
|
|
||||||
{
|
|
||||||
readPayload(raw);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QAmqpContentBodyFrame::setBody(const QByteArray &data)
|
void QAmqpContentBodyFrame::setBody(const QByteArray &data)
|
||||||
{
|
{
|
||||||
body_ = data;
|
body_ = data;
|
||||||
|
|
@ -460,7 +441,7 @@ qint32 QAmqpContentBodyFrame::size() const
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
QAmqpHeartbeatFrame::QAmqpHeartbeatFrame()
|
QAmqpHeartbeatFrame::QAmqpHeartbeatFrame()
|
||||||
: QAmqpFrame(QAmqpFrame::ftHeartbeat)
|
: QAmqpFrame(QAmqpFrame::Heartbeat)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,128 +8,47 @@
|
||||||
#include "qamqpglobal.h"
|
#include "qamqpglobal.h"
|
||||||
#include "qamqpmessage.h"
|
#include "qamqpmessage.h"
|
||||||
|
|
||||||
class QAmqpQueuePrivate;
|
class QAmqpFramePrivate;
|
||||||
|
|
||||||
/**
|
|
||||||
* Library namespace
|
|
||||||
* @namespace QAMQP
|
|
||||||
*/
|
|
||||||
|
|
||||||
class QAmqpFrame
|
class QAmqpFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/*
|
|
||||||
* @brief Header size in bytes
|
|
||||||
*/
|
|
||||||
static const qint64 HEADER_SIZE = 7;
|
static const qint64 HEADER_SIZE = 7;
|
||||||
|
|
||||||
/*
|
|
||||||
* @brief Frame end indicator size in bytes
|
|
||||||
*/
|
|
||||||
static const qint64 FRAME_END_SIZE = 1;
|
static const qint64 FRAME_END_SIZE = 1;
|
||||||
|
|
||||||
/*
|
|
||||||
* @brief Frame end marker
|
|
||||||
*/
|
|
||||||
static const quint8 FRAME_END = 0xCE;
|
static const quint8 FRAME_END = 0xCE;
|
||||||
|
|
||||||
/*
|
enum FrameType
|
||||||
* @brief Frame type
|
|
||||||
*/
|
|
||||||
enum Type
|
|
||||||
{
|
{
|
||||||
ftMethod = 1, /*!< Used define method frame */
|
Method = 1,
|
||||||
ftHeader = 2, /*!< Used define content header frame */
|
Header = 2,
|
||||||
ftBody = 3, /*!< Used define content body frame */
|
Body = 3,
|
||||||
ftHeartbeat = 8 /*!< Used define heartbeat frame */
|
Heartbeat = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* @brief Frame method class
|
|
||||||
* @enum MethodClass
|
|
||||||
*/
|
|
||||||
enum MethodClass
|
enum MethodClass
|
||||||
{
|
{
|
||||||
fcConnection = 10, // Define class of methods related to connection
|
Connection = 10,
|
||||||
fcChannel = 20, // Define class of methods related to channel
|
Channel = 20,
|
||||||
fcExchange = 40, // Define class of methods related to exchange
|
Exchange = 40,
|
||||||
fcQueue = 50, // Define class of methods related to queue
|
Queue = 50,
|
||||||
fcBasic = 60, // Define class of methods related to basic command
|
Basic = 60,
|
||||||
fcTx = 90,
|
Tx = 90,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtual ~QAmqpFrame();
|
||||||
|
|
||||||
|
FrameType type() const;
|
||||||
|
|
||||||
|
qint16 channel() const;
|
||||||
|
void setChannel(qint16 channel);
|
||||||
|
|
||||||
|
virtual qint32 size() const;
|
||||||
|
|
||||||
static QVariant readAmqpField(QDataStream &s, QAmqpMetaType::ValueType type);
|
static QVariant readAmqpField(QDataStream &s, QAmqpMetaType::ValueType type);
|
||||||
static void writeAmqpField(QDataStream &s, QAmqpMetaType::ValueType type, const QVariant &value);
|
static void writeAmqpField(QDataStream &s, QAmqpMetaType::ValueType type, const QVariant &value);
|
||||||
|
|
||||||
/*
|
|
||||||
* @brief Base class for any frames.
|
|
||||||
* @detailed Implement main methods for serialize and deserialize raw frame data.
|
|
||||||
* All frames start with a 7-octet header composed of a type field (octet), a channel field (short integer) and a
|
|
||||||
* size field (long integer):
|
|
||||||
* @code Frame struct
|
|
||||||
* 0 1 3 7 size+7 size+8
|
|
||||||
* +------+---------+---------+ +-------------+ +-----------+
|
|
||||||
* | type | channel | size | | payload | | frame-end |
|
|
||||||
* +------+---------+---------+ +-------------+ +-----------+
|
|
||||||
* @endcode
|
|
||||||
* octet short long 'size' octets octet
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Base class constructor.
|
|
||||||
* @detailed Construct frame class for sending.
|
|
||||||
* @param type Define type of constructed frame.
|
|
||||||
*/
|
|
||||||
QAmqpFrame(Type type);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Base class constructor.
|
|
||||||
* @detailed Construct frame class from received raw data.
|
|
||||||
* @param raw Data stream for reading source data.
|
|
||||||
*/
|
|
||||||
QAmqpFrame(QDataStream &raw);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Base class virtual destructor
|
|
||||||
*/
|
|
||||||
virtual ~QAmqpFrame();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Frame type
|
|
||||||
* @detailed Return type of current frame.
|
|
||||||
*/
|
|
||||||
Type type() const;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Set number of associated channel.
|
|
||||||
* @param channel Number of channel.
|
|
||||||
* @sa channel()
|
|
||||||
*/
|
|
||||||
void setChannel(qint16 channel);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return number of associated channel.
|
|
||||||
* @sa setChannel()
|
|
||||||
*/
|
|
||||||
qint16 channel() const;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return size of frame.
|
|
||||||
*/
|
|
||||||
virtual qint32 size() const;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Output frame to stream.
|
|
||||||
* @param stream Stream for serilize frame.
|
|
||||||
*/
|
|
||||||
void toStream(QDataStream &stream) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void writeHeader(QDataStream &stream) const;
|
explicit QAmqpFrame(FrameType type);
|
||||||
virtual void writePayload(QDataStream &stream) const = 0;
|
virtual void writePayload(QDataStream &stream) const = 0;
|
||||||
void writeEnd(QDataStream &stream) const;
|
|
||||||
|
|
||||||
void readHeader(QDataStream &stream);
|
|
||||||
virtual void readPayload(QDataStream &stream) = 0;
|
virtual void readPayload(QDataStream &stream) = 0;
|
||||||
|
|
||||||
qint32 size_;
|
qint32 size_;
|
||||||
|
|
@ -138,212 +57,104 @@ private:
|
||||||
qint8 type_;
|
qint8 type_;
|
||||||
qint16 channel_;
|
qint16 channel_;
|
||||||
|
|
||||||
|
friend QDataStream &operator<<(QDataStream &stream, const QAmqpFrame &frame);
|
||||||
|
friend QDataStream &operator>>(QDataStream &stream, QAmqpFrame &frame);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
QDataStream &operator<<(QDataStream &, const QAmqpFrame &frame);
|
||||||
* @brief Class for working with method frames.
|
QDataStream &operator>>(QDataStream &, QAmqpFrame &frame);
|
||||||
* @detailed Implement main methods for serialize and deserialize raw method frame data.
|
|
||||||
* Method frame bodies consist of an invariant list of data fields, called "arguments". All method bodies start
|
|
||||||
* with identifier numbers for the class and method:
|
|
||||||
* @code Frame struct
|
|
||||||
* 0 2 4
|
|
||||||
* +----------+-----------+-------------- - -
|
|
||||||
* | class-id | method-id | arguments...
|
|
||||||
* +----------+-----------+-------------- - -
|
|
||||||
* short short ...
|
|
||||||
* @endcode
|
|
||||||
*/
|
|
||||||
class QAMQP_EXPORT QAmqpMethodFrame : public QAmqpFrame
|
class QAMQP_EXPORT QAmqpMethodFrame : public QAmqpFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/*
|
QAmqpMethodFrame();
|
||||||
* Method class constructor.
|
QAmqpMethodFrame(MethodClass methodClass, qint16 id);
|
||||||
* @detailed Construct frame class for sending.
|
|
||||||
* @param methodClass Define method class id of constructed frame.
|
|
||||||
* @param id Define method id of constructed frame.
|
|
||||||
*/
|
|
||||||
explicit QAmqpMethodFrame(MethodClass methodClass, qint16 id);
|
|
||||||
|
|
||||||
/*
|
qint16 id() const;
|
||||||
* Method class constructor.
|
|
||||||
* @detailed Construct frame class from received raw data.
|
|
||||||
* @param raw Data stream for reading source data.
|
|
||||||
*/
|
|
||||||
explicit QAmqpMethodFrame(QDataStream &raw);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Method class type.
|
|
||||||
*/
|
|
||||||
MethodClass methodClass() const;
|
MethodClass methodClass() const;
|
||||||
|
|
||||||
/*
|
virtual qint32 size() const;
|
||||||
* Method id.
|
|
||||||
*/
|
|
||||||
qint16 id() const;
|
|
||||||
qint32 size() const;
|
|
||||||
|
|
||||||
/*
|
QByteArray arguments() const;
|
||||||
* Set arguments for method.
|
|
||||||
* @param data Serialized method arguments.
|
|
||||||
* @sa arguments
|
|
||||||
*/
|
|
||||||
void setArguments(const QByteArray &data);
|
void setArguments(const QByteArray &data);
|
||||||
|
|
||||||
/*
|
private:
|
||||||
* Return arguments for method.
|
|
||||||
* @sa setArguments
|
|
||||||
*/
|
|
||||||
QByteArray arguments() const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void writePayload(QDataStream &stream) const;
|
void writePayload(QDataStream &stream) const;
|
||||||
void readPayload(QDataStream &stream);
|
void readPayload(QDataStream &stream);
|
||||||
|
|
||||||
short methodClass_;
|
short methodClass_;
|
||||||
qint16 id_;
|
qint16 id_;
|
||||||
QByteArray arguments_;
|
QByteArray arguments_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
class QAmqpContentFrame : public QAmqpFrame
|
||||||
* @brief Class for working with content frames.
|
|
||||||
* @detailed Implement main methods for serialize and deserialize raw content frame data.
|
|
||||||
* A content header payload has this format:
|
|
||||||
* @code Frame struct
|
|
||||||
* +----------+--------+-----------+----------------+------------- - -
|
|
||||||
* | class-id | weight | body size | property flags | property list...
|
|
||||||
* +----------+--------+-----------+----------------+------------- - -
|
|
||||||
* short short long long short remainder...
|
|
||||||
* @endcode
|
|
||||||
*
|
|
||||||
* | Property | Description |
|
|
||||||
* | ---------------- | -------------------------------------- |
|
|
||||||
* | ContentType | MIME content type |
|
|
||||||
* | ContentEncoding | MIME content encoding |
|
|
||||||
* | Headers | message header field table |
|
|
||||||
* | DeliveryMode | nonpersistent (1) or persistent (2) |
|
|
||||||
* | Priority | message priority, 0 to 9 |
|
|
||||||
* | CorrelationId | application correlation identifier |
|
|
||||||
* | ReplyTo | address to reply to |
|
|
||||||
* | Expiration | message expiration specification |
|
|
||||||
* | MessageId | application message identifier |
|
|
||||||
* | Timestamp | message timestamp |
|
|
||||||
* | Type | message type name |
|
|
||||||
* | UserId | creating user id |
|
|
||||||
* | AppId | creating application id |
|
|
||||||
* | ClusterID | cluster ID |
|
|
||||||
*
|
|
||||||
* Default property:
|
|
||||||
* @sa setProperty
|
|
||||||
* @sa property
|
|
||||||
*/
|
|
||||||
class QAMQP_EXPORT QAmqpContentFrame : public QAmqpFrame
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/*
|
|
||||||
* Content class constructor.
|
|
||||||
* @detailed Construct frame content header class for sending.
|
|
||||||
*/
|
|
||||||
QAmqpContentFrame();
|
QAmqpContentFrame();
|
||||||
|
|
||||||
/*
|
|
||||||
* Content class constructor.
|
|
||||||
* @detailed Construct frame content header class for sending.
|
|
||||||
* @param methodClass Define method class id of constructed frame.
|
|
||||||
*/
|
|
||||||
QAmqpContentFrame(MethodClass methodClass);
|
QAmqpContentFrame(MethodClass methodClass);
|
||||||
|
|
||||||
/*
|
|
||||||
* Content class constructor.
|
|
||||||
* @detailed Construct frame content header class for sending.
|
|
||||||
* @param raw Data stream for reading source data.
|
|
||||||
*/
|
|
||||||
QAmqpContentFrame(QDataStream &raw);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Method class type.
|
|
||||||
*/
|
|
||||||
MethodClass methodClass() const;
|
MethodClass methodClass() const;
|
||||||
qint32 size() const;
|
|
||||||
|
|
||||||
/*
|
virtual qint32 size() const;
|
||||||
* Set default content header property
|
|
||||||
* @param prop Any default content header property
|
|
||||||
* @param value Associated data
|
|
||||||
*/
|
|
||||||
void setProperty(QAmqpMessage::Property prop, const QVariant &value);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return associated with property value
|
|
||||||
* @param prop Any default content header property
|
|
||||||
*/
|
|
||||||
QVariant property(QAmqpMessage::Property prop) const;
|
QVariant property(QAmqpMessage::Property prop) const;
|
||||||
|
void setProperty(QAmqpMessage::Property prop, const QVariant &value);
|
||||||
|
|
||||||
qlonglong bodySize() const;
|
qlonglong bodySize() const;
|
||||||
void setBodySize(qlonglong size);
|
void setBodySize(qlonglong size);
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
void writePayload(QDataStream &stream) const;
|
void writePayload(QDataStream &stream) const;
|
||||||
void readPayload(QDataStream &stream);
|
void readPayload(QDataStream &stream);
|
||||||
|
friend class QAmqpQueuePrivate;
|
||||||
|
|
||||||
short methodClass_;
|
short methodClass_;
|
||||||
qint16 id_;
|
qint16 id_;
|
||||||
mutable QByteArray buffer_;
|
mutable QByteArray buffer_;
|
||||||
QAmqpMessage::PropertyHash properties_;
|
QAmqpMessage::PropertyHash properties_;
|
||||||
qlonglong bodySize_;
|
qlonglong bodySize_;
|
||||||
|
|
||||||
private:
|
|
||||||
friend class QAmqpQueuePrivate;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QAMQP_EXPORT QAmqpContentBodyFrame : public QAmqpFrame
|
class QAmqpContentBodyFrame : public QAmqpFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QAmqpContentBodyFrame();
|
QAmqpContentBodyFrame();
|
||||||
QAmqpContentBodyFrame(QDataStream &raw);
|
|
||||||
|
|
||||||
void setBody(const QByteArray &data);
|
void setBody(const QByteArray &data);
|
||||||
QByteArray body() const;
|
QByteArray body() const;
|
||||||
|
|
||||||
qint32 size() const;
|
virtual qint32 size() const;
|
||||||
protected:
|
|
||||||
|
private:
|
||||||
void writePayload(QDataStream &stream) const;
|
void writePayload(QDataStream &stream) const;
|
||||||
void readPayload(QDataStream &stream);
|
void readPayload(QDataStream &stream);
|
||||||
|
|
||||||
private:
|
|
||||||
QByteArray body_;
|
QByteArray body_;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
class QAmqpHeartbeatFrame : public QAmqpFrame
|
||||||
* @brief Class for working with heartbeat frames.
|
|
||||||
* @detailed Implement frame for heartbeat send.
|
|
||||||
*/
|
|
||||||
class QAMQP_EXPORT QAmqpHeartbeatFrame : public QAmqpFrame
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/*
|
|
||||||
* Heartbeat class constructor.
|
|
||||||
* @detailed Construct frame class for sending.
|
|
||||||
*/
|
|
||||||
QAmqpHeartbeatFrame();
|
QAmqpHeartbeatFrame();
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
void writePayload(QDataStream &stream) const;
|
void writePayload(QDataStream &stream) const;
|
||||||
void readPayload(QDataStream &stream);
|
void readPayload(QDataStream &stream);
|
||||||
};
|
};
|
||||||
|
|
||||||
class QAMQP_EXPORT QAmqpMethodFrameHandler
|
class QAmqpMethodFrameHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual bool _q_method(const QAmqpMethodFrame &frame) = 0;
|
virtual bool _q_method(const QAmqpMethodFrame &frame) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QAMQP_EXPORT QAmqpContentFrameHandler
|
class QAmqpContentFrameHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void _q_content(const QAmqpContentFrame &frame) = 0;
|
virtual void _q_content(const QAmqpContentFrame &frame) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QAMQP_EXPORT QAmqpContentBodyFrameHandler
|
class QAmqpContentBodyFrameHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void _q_body(const QAmqpContentBodyFrame &frame) = 0;
|
virtual void _q_body(const QAmqpContentBodyFrame &frame) = 0;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ bool QAmqpQueuePrivate::_q_method(const QAmqpMethodFrame &frame)
|
||||||
if (QAmqpChannelPrivate::_q_method(frame))
|
if (QAmqpChannelPrivate::_q_method(frame))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (frame.methodClass() == QAmqpFrame::fcQueue) {
|
if (frame.methodClass() == QAmqpFrame::Queue) {
|
||||||
switch (frame.id()) {
|
switch (frame.id()) {
|
||||||
case miDeclareOk:
|
case miDeclareOk:
|
||||||
declareOk(frame);
|
declareOk(frame);
|
||||||
|
|
@ -51,7 +51,7 @@ bool QAmqpQueuePrivate::_q_method(const QAmqpMethodFrame &frame)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame.methodClass() == QAmqpFrame::fcBasic) {
|
if (frame.methodClass() == QAmqpFrame::Basic) {
|
||||||
switch(frame.id()) {
|
switch(frame.id()) {
|
||||||
case bmConsumeOk:
|
case bmConsumeOk:
|
||||||
consumeOk(frame);
|
consumeOk(frame);
|
||||||
|
|
@ -235,7 +235,7 @@ void QAmqpQueuePrivate::deliver(const QAmqpMethodFrame &frame)
|
||||||
|
|
||||||
void QAmqpQueuePrivate::declare()
|
void QAmqpQueuePrivate::declare()
|
||||||
{
|
{
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcQueue, QAmqpQueuePrivate::miDeclare);
|
QAmqpMethodFrame frame(QAmqpFrame::Queue, QAmqpQueuePrivate::miDeclare);
|
||||||
frame.setChannel(channelNumber);
|
frame.setChannel(channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
@ -327,7 +327,7 @@ void QAmqpQueue::remove(int options)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcQueue, QAmqpQueuePrivate::miDelete);
|
QAmqpMethodFrame frame(QAmqpFrame::Queue, QAmqpQueuePrivate::miDelete);
|
||||||
frame.setChannel(d->channelNumber);
|
frame.setChannel(d->channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
@ -348,7 +348,7 @@ void QAmqpQueue::purge()
|
||||||
if (!d->opened)
|
if (!d->opened)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcQueue, QAmqpQueuePrivate::miPurge);
|
QAmqpMethodFrame frame(QAmqpFrame::Queue, QAmqpQueuePrivate::miPurge);
|
||||||
frame.setChannel(d->channelNumber);
|
frame.setChannel(d->channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
@ -379,7 +379,7 @@ void QAmqpQueue::bind(const QString &exchangeName, const QString &key)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcQueue, QAmqpQueuePrivate::miBind);
|
QAmqpMethodFrame frame(QAmqpFrame::Queue, QAmqpQueuePrivate::miBind);
|
||||||
frame.setChannel(d->channelNumber);
|
frame.setChannel(d->channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
@ -415,7 +415,7 @@ void QAmqpQueue::unbind(const QString &exchangeName, const QString &key)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcQueue, QAmqpQueuePrivate::miUnbind);
|
QAmqpMethodFrame frame(QAmqpFrame::Queue, QAmqpQueuePrivate::miUnbind);
|
||||||
frame.setChannel(d->channelNumber);
|
frame.setChannel(d->channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
@ -443,7 +443,7 @@ bool QAmqpQueue::consume(int options)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcBasic, QAmqpQueuePrivate::bmConsume);
|
QAmqpMethodFrame frame(QAmqpFrame::Basic, QAmqpQueuePrivate::bmConsume);
|
||||||
frame.setChannel(d->channelNumber);
|
frame.setChannel(d->channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
@ -487,7 +487,7 @@ void QAmqpQueue::get(bool noAck)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcBasic, QAmqpQueuePrivate::bmGet);
|
QAmqpMethodFrame frame(QAmqpFrame::Basic, QAmqpQueuePrivate::bmGet);
|
||||||
frame.setChannel(d->channelNumber);
|
frame.setChannel(d->channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
@ -509,7 +509,7 @@ void QAmqpQueue::ack(const QAmqpMessage &message)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcBasic, QAmqpQueuePrivate::bmAck);
|
QAmqpMethodFrame frame(QAmqpFrame::Basic, QAmqpQueuePrivate::bmAck);
|
||||||
frame.setChannel(d->channelNumber);
|
frame.setChannel(d->channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
@ -535,7 +535,7 @@ bool QAmqpQueue::cancel(bool noWait)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAmqpMethodFrame frame(QAmqpFrame::fcBasic, QAmqpQueuePrivate::bmCancel);
|
QAmqpMethodFrame frame(QAmqpFrame::Basic, QAmqpQueuePrivate::bmCancel);
|
||||||
frame.setChannel(d->channelNumber);
|
frame.setChannel(d->channelNumber);
|
||||||
|
|
||||||
QByteArray arguments;
|
QByteArray arguments;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue