Remove GetSocket interface that exposes transport details

This commit is contained in:
Alexey Rybalchenko
2018-10-16 13:27:30 +02:00
committed by Dennis Klein
parent f8824335a5
commit ce4062f3a0
27 changed files with 59 additions and 189 deletions

View File

@@ -416,12 +416,7 @@ void FairMQSocketNN::Resume()
fInterrupted = false;
}
void* FairMQSocketNN::GetSocket() const
{
return nullptr; // dummy method to comply with the interface. functionality not possible in zeromq.
}
int FairMQSocketNN::GetSocket(int /*nothing*/) const
int FairMQSocketNN::GetSocket() const
{
return fSocket;
}
@@ -445,8 +440,7 @@ void FairMQSocketNN::SetOption(const string& option, const void* value, size_t v
if (option == "linger")
{
int val = *(static_cast<int*>(const_cast<void*>(value)));
fLinger = val;
fLinger = *static_cast<int*>(const_cast<void*>(value));
return;
}
@@ -459,6 +453,19 @@ void FairMQSocketNN::SetOption(const string& option, const void* value, size_t v
void FairMQSocketNN::GetOption(const string& option, void* value, size_t* valueSize)
{
if (option == "linger")
{
*static_cast<int*>(value) = fLinger;
return;
}
if (option == "snd-hwm" || option == "rcv-hwm")
{
*static_cast<int*>(value) = -1;
return;
}
int rc = nn_getsockopt(fSocket, NN_SOL_SOCKET, GetConstant(option), value, valueSize);
if (rc < 0)
{