View Issue Details

IDProjectCategoryView StatusLast Update
0004167Slicer4Module OpenIGTLinkIFpublic2017-08-14 09:34
Reporterleochan2009Assigned Totokuda 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
PlatformMac osOSOS Version
Product Version 
Target VersionFixed in VersionSlicer 4.7.0 
Summary0004167: The OpenIGTLink SetSendBlocking code is duplicated from SetReceiveBlocking
Description

The code in SetSendingBlocking seems copied from SetReceiveBlocking

Additional Information

//-----------------------------------------------------------------------------
int Socket::SetReceiveBlocking(int sw)
{
if (!this->GetConnected())
{
return 0;
}

// If sw == 1, timeout is set to 0 (wait until it receives message)
#if defined(_WIN32) && !defined(CYGWIN)
if (sw==0)
{
this->m_ReceiveTimeout = 1;
}
else
{
this->m_ReceiveTimeout = 0;
}
int len;
#else
if (sw==0)
{
this->m_ReceiveTimeout.tv_sec = 0; / second /
this->m_ReceiveTimeout.tv_usec = 1; / nanosecond /
}
else
{
this->m_ReceiveTimeout.tv_sec = 0; / second /
this->m_ReceiveTimeout.tv_usec = 0; / nanosecond /
}
socklen_t len;
#endif
if (sw==0)
{
getsockopt(this->m_SocketDescriptor, SOL_SOCKET, SO_RCVTIMEO,
(char)&(this->m_OrigReceiveTimeout), &len);
setsockopt(this->m_SocketDescriptor, SOL_SOCKET, SO_RCVTIMEO,
(char
)&(this->m_ReceiveTimeout), sizeof(this->m_ReceiveTimeout));
this->m_ReceiveTimeoutFlag = 1;
}
else if (this->m_ReceiveTimeoutFlag)
{
setsockopt(this->m_SocketDescriptor, SOL_SOCKET, SO_RCVTIMEO,
(char*)&(this->m_OrigReceiveTimeout), sizeof(this->m_OrigReceiveTimeout));
this->m_ReceiveTimeoutFlag = 0;
}

return sw;
}

//-----------------------------------------------------------------------------
int Socket::SetSendBlocking(int sw)
{
if (!this->GetConnected())
{
return 0;
}

// If sw == 1, timeout is set to 0 (wait until it receives message)
#if defined(_WIN32) && !defined(CYGWIN)
if (sw==0)
{
this->m_ReceiveTimeout = 1;
}
else
{
this->m_ReceiveTimeout = 0;
}
int len;
#else
if (sw==0)
{
this->m_ReceiveTimeout.tv_sec = 0; / second /
this->m_ReceiveTimeout.tv_usec = 1; / nanosecond /
}
else
{
this->m_ReceiveTimeout.tv_sec = 0; / second /
this->m_ReceiveTimeout.tv_usec = 0; / nanosecond /
}
socklen_t len;
#endif
if (sw==0)
{
getsockopt(this->m_SocketDescriptor, SOL_SOCKET, SO_SNDTIMEO,
(char)&(this->m_OrigSendTimeout), &len);
setsockopt(this->m_SocketDescriptor, SOL_SOCKET, SO_SNDTIMEO,
(char
)&(this->m_SendTimeout), sizeof(this->m_SendTimeout));
this->m_SendTimeoutFlag = 1;
}
else if (this->m_SendTimeoutFlag)
{
setsockopt(this->m_SocketDescriptor, SOL_SOCKET, SO_SNDTIMEO,
(char*)&(this->m_OrigSendTimeout), sizeof(this->m_OrigSendTimeout));
this->m_SendTimeoutFlag = 0;
}

return sw;
}

TagsNo tags attached.

Activities

jcfr

jcfr

2017-08-14 09:33

administrator   ~0015046

The version of OpenIGTLink used in Slicer is the latest one. Please report the issue upstream if this is still a problem.

Issue History

Date Modified Username Field Change
2016-04-07 10:50 leochan2009 New Issue
2016-04-07 10:50 leochan2009 Status new => assigned
2016-04-07 10:50 leochan2009 Assigned To => tokuda
2017-08-14 09:33 jcfr Status assigned => resolved
2017-08-14 09:33 jcfr Resolution open => no change required
2017-08-14 09:33 jcfr Note Added: 0015046
2017-08-14 09:34 jcfr Fixed in Version => Slicer 4.7.0
2017-08-14 09:34 jcfr Additional Information Updated View Revisions