shmem: fail earlier if given an unsupported socket type

This commit is contained in:
Alexey Rybalchenko 2020-09-22 11:31:52 +02:00 committed by Dennis Klein
parent cf004f69b2
commit d03a504ccd

View File

@ -58,6 +58,12 @@ class Socket final : public fair::mq::Socket
, fTimeout(100) , fTimeout(100)
{ {
assert(context); assert(context);
if (type == "sub" || type == "pub") {
LOG(error) << "PUB/SUB socket type is not supported for shared memory transport";
throw SocketError("PUB/SUB socket type is not supported for shared memory transport");
}
fSocket = zmq_socket(context, GetConstant(type)); fSocket = zmq_socket(context, GetConstant(type));
if (fSocket == nullptr) { if (fSocket == nullptr) {