Implement nanomsg linger in our transport

This commit is contained in:
Alexey Rybalchenko
2018-10-12 17:10:14 +02:00
committed by Dennis Klein
parent cfb727181f
commit 44acd4997d
16 changed files with 116 additions and 14 deletions

View File

@@ -39,6 +39,7 @@ FairMQSocketNN::FairMQSocketNN(const string& type, const string& name, const str
, fMessagesRx(0)
, fSndTimeout(100)
, fRcvTimeout(100)
, fLinger(500)
{
if (type == "router" || type == "dealer")
{
@@ -456,6 +457,13 @@ void FairMQSocketNN::SetOption(const string& option, const void* value, size_t v
return;
}
if (option == "linger")
{
int val = *(static_cast<int*>(const_cast<void*>(value)));
fLinger = val;
return;
}
int rc = nn_setsockopt(fSocket, NN_SOL_SOCKET, GetConstant(option), value, valueSize);
if (rc < 0)
{