summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/sys/rdma/RdmaIO.cpp16
-rw-r--r--cpp/src/qpid/sys/rdma/RdmaIO.h2
2 files changed, 17 insertions, 1 deletions
diff --git a/cpp/src/qpid/sys/rdma/RdmaIO.cpp b/cpp/src/qpid/sys/rdma/RdmaIO.cpp
index 889544601f..b47165a302 100644
--- a/cpp/src/qpid/sys/rdma/RdmaIO.cpp
+++ b/cpp/src/qpid/sys/rdma/RdmaIO.cpp
@@ -22,7 +22,7 @@
#include "qpid/log/Statement.h"
-#include <iostream>
+#include <string>
#include <boost/bind.hpp>
using qpid::sys::SocketAddress;
@@ -69,6 +69,18 @@ namespace Rdma {
};
# pragma pack(pop)
+ class IOException : public std::exception {
+ std::string s;
+
+ public:
+ IOException(std::string s0): s(s0) {}
+ ~IOException() throw() {}
+
+ const char* what() const throw() {
+ return s.c_str();
+ }
+ };
+
AsynchIO::AsynchIO(
QueuePair::intrusive_ptr q,
int version,
@@ -97,6 +109,8 @@ namespace Rdma {
errorCallback(ec),
pendingWriteAction(boost::bind(&AsynchIO::writeEvent, this))
{
+ if (protocolVersion > maxSupportedProtocolVersion)
+ throw IOException("Unsupported Rdma Protocol");
qp->nonblocking();
qp->notifyRecv();
qp->notifySend();
diff --git a/cpp/src/qpid/sys/rdma/RdmaIO.h b/cpp/src/qpid/sys/rdma/RdmaIO.h
index 7a72feba4c..3a543e8ad6 100644
--- a/cpp/src/qpid/sys/rdma/RdmaIO.h
+++ b/cpp/src/qpid/sys/rdma/RdmaIO.h
@@ -98,6 +98,8 @@ namespace Rdma {
void returnBuffer(Buffer*);
private:
+ const static int maxSupportedProtocolVersion = 0;
+
// Constants for the peer-peer command messages
// These are sent in the high bits if the imm data of an rdma message
// The low bits are used to send the credit