diff options
| author | Gordon Sim <gsim@apache.org> | 2007-08-05 13:25:36 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2007-08-05 13:25:36 +0000 |
| commit | b2efcb6ed3e1e2104836928cda81ed69f2f24559 (patch) | |
| tree | 392ae403dcb0d32da3edaeaf8a1f497679d9102c /cpp/src/qpid/client/ExecutionHandler.cpp | |
| parent | b2fadec5d86e278d96112e915e67aec934e91046 (diff) | |
| download | qpid-python-b2efcb6ed3e1e2104836928cda81ed69f2f24559.tar.gz | |
Added first cut of generated client interface.
Old channel interface still supported; shares SessionCore with the new interface.
Todo: allow applications to signal completion of received commands; keywrod args for interface.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@562866 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/ExecutionHandler.cpp')
| -rw-r--r-- | cpp/src/qpid/client/ExecutionHandler.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/cpp/src/qpid/client/ExecutionHandler.cpp b/cpp/src/qpid/client/ExecutionHandler.cpp index e4270f4e98..abfce4f9d1 100644 --- a/cpp/src/qpid/client/ExecutionHandler.cpp +++ b/cpp/src/qpid/client/ExecutionHandler.cpp @@ -50,7 +50,8 @@ bool invoke(AMQBody::shared_ptr body, Invocable* target) return body->type() == METHOD_BODY && shared_polymorphic_cast<AMQMethodBody>(body)->invoke(target); } -ExecutionHandler::ExecutionHandler() : version(framing::highestProtocolVersion) {} +ExecutionHandler::ExecutionHandler(uint64_t _maxFrameSize) : + version(framing::highestProtocolVersion), maxFrameSize(_maxFrameSize) {} //incoming: void ExecutionHandler::handle(AMQFrame& frame) @@ -97,6 +98,12 @@ void ExecutionHandler::flush() //make_shared_ptr(new ExecutionCompleteBody(getVersion(), incoming.hwm.getValue(), SequenceNumberSet()))); } +void ExecutionHandler::sendFlush() +{ + AMQFrame frame(version, 0, make_shared_ptr(new ExecutionFlushBody(version))); + out(frame); +} + void ExecutionHandler::send(AMQBody::shared_ptr command, CompletionTracker::Listener f, Correlator::Listener g) { //allocate id: @@ -111,21 +118,9 @@ void ExecutionHandler::send(AMQBody::shared_ptr command, CompletionTracker::List AMQFrame frame(version, 0/*id will be filled in be channel handler*/, command); out(frame); - - if (f) { - AMQFrame frame(version, 0, make_shared_ptr(new ExecutionFlushBody(version))); - out(frame); - } -} - -void ExecutionHandler::sendContent(framing::AMQBody::shared_ptr content) -{ - AMQFrame frame(version, 0/*id will be filled in be channel handler*/, content); - out(frame); } void ExecutionHandler::sendContent(AMQBody::shared_ptr command, const BasicHeaderProperties& headers, const std::string& data, - uint64_t frameSize, CompletionTracker::Listener f, Correlator::Listener g) { send(command, f, g); @@ -139,7 +134,7 @@ void ExecutionHandler::sendContent(AMQBody::shared_ptr command, const BasicHeade u_int64_t data_length = data.length(); if(data_length > 0){ //frame itself uses 8 bytes - u_int32_t frag_size = frameSize - 8; + u_int32_t frag_size = maxFrameSize - 8; if(data_length < frag_size){ AMQFrame frame(version, 0, make_shared_ptr(new AMQContentBody(data))); out(frame); |
