From d03a504ccde3b4840125f70ab98b09b85db9894d Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Tue, 22 Sep 2020 11:31:52 +0200 Subject: [PATCH] shmem: fail earlier if given an unsupported socket type --- fairmq/shmem/Socket.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fairmq/shmem/Socket.h b/fairmq/shmem/Socket.h index 22488dd0..044177fb 100644 --- a/fairmq/shmem/Socket.h +++ b/fairmq/shmem/Socket.h @@ -58,6 +58,12 @@ class Socket final : public fair::mq::Socket , fTimeout(100) { 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)); if (fSocket == nullptr) {