Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/lib/rtm/InPortCorbaCdrConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#include <rtm/NVUtil.h>
#include <rtm/InPortCorbaCdrConsumer.h>

#if defined(minor)
#undef minor
#endif

namespace RTC
{
/*!
Expand Down Expand Up @@ -83,6 +87,27 @@ namespace RTC
// (IDL)OpenRTM::DataPort::ReturnCode_t -> DataPortStatus
return convertReturnCode(_ptr()->put(m_data));
}
#ifdef ORB_IS_OMNIORB
catch (const CORBA::COMM_FAILURE& ex)
{
if (ex.minor() == omni::COMM_FAILURE_WaitingForReply)
{
RTC_DEBUG(("Retry put message"));
try
{
return convertReturnCode(_ptr()->put(m_data));
}
catch (...)
{
return DataPortStatus::CONNECTION_LOST;
}
}
else
{
return DataPortStatus::CONNECTION_LOST;
}
}
#endif
catch (...)
{
return DataPortStatus::CONNECTION_LOST;
Expand Down
25 changes: 25 additions & 0 deletions src/lib/rtm/InPortDSConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#include <rtm/NVUtil.h>
#include <rtm/InPortDSConsumer.h>

#if defined(minor)
#undef minor
#endif

namespace RTC
{
/*!
Expand Down Expand Up @@ -82,6 +86,27 @@ namespace RTC
// (IDL)OpenRTM::DataPort::ReturnCode_t -> DataPortStatus
return convertReturnCode(_ptr()->push(m_data));
}
#ifdef ORB_IS_OMNIORB
catch (const CORBA::COMM_FAILURE& ex)
{
if (ex.minor() == omni::COMM_FAILURE_WaitingForReply)
{
RTC_DEBUG(("Retry push message"));
try
{
return convertReturnCode(_ptr()->push(m_data));
}
catch (...)
{
return DataPortStatus::CONNECTION_LOST;
}
}
else
{
return DataPortStatus::CONNECTION_LOST;
}
}
#endif
catch (...)
{
return DataPortStatus::CONNECTION_LOST;
Expand Down
31 changes: 30 additions & 1 deletion src/lib/rtm/InPortSHMConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#include <mutex>
#include <memory>

#if defined(minor)
#undef minor
#endif


namespace RTC
{
Expand Down Expand Up @@ -109,15 +113,40 @@ namespace RTC
{
RTC_PARANOID(("put()"));

std::lock_guard<std::mutex> guard(m_mutex);
try
{
std::lock_guard<std::mutex> guard(m_mutex);
m_shmem.setEndian(m_endian);
m_shmem.create_memory(m_memory_size, m_shm_address.c_str());
m_shmem.write(data);

return convertReturnCode(_ptr()->put());
}
#ifdef ORB_IS_OMNIORB
catch (const CORBA::COMM_FAILURE& ex)
{
if (ex.minor() == omni::COMM_FAILURE_WaitingForReply)
{
RTC_DEBUG(("Retry put message"));
try
{
m_shmem.setEndian(m_endian);
m_shmem.create_memory(m_memory_size, m_shm_address.c_str());
m_shmem.write(data);

return convertReturnCode(_ptr()->put());
}
catch (...)
{
return DataPortStatus::CONNECTION_LOST;
}
}
else
{
return DataPortStatus::CONNECTION_LOST;
}
}
#endif
catch (...)
{
return DataPortStatus::CONNECTION_LOST;
Expand Down
28 changes: 27 additions & 1 deletion src/lib/rtm/OutPortCorbaCdrConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#include <rtm/OutPortCorbaCdrConsumer.h>
#include <rtm/NVUtil.h>

#if defined(minor)
#undef minor
#endif

namespace RTC
{
/*!
Expand Down Expand Up @@ -99,7 +103,29 @@ namespace RTC

try
{
::OpenRTM::PortStatus ret(_ptr()->get(cdr_data.out()));
::OpenRTM::PortStatus ret(::OpenRTM::PortStatus::PORT_ERROR);
try
{
ret = _ptr()->get(cdr_data.out());
}
#ifdef ORB_IS_OMNIORB
catch (const CORBA::COMM_FAILURE& ex)
{
if (ex.minor() == omni::COMM_FAILURE_WaitingForReply)
{
RTC_DEBUG(("Retry get message"));
ret = _ptr()->get(cdr_data.out());
}
else
{
throw;
}
}
#endif
catch (...)
{
throw;
}

if (ret == ::OpenRTM::PORT_OK)
{
Expand Down
28 changes: 27 additions & 1 deletion src/lib/rtm/OutPortDSConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#include <rtm/OutPortDSConsumer.h>
#include <rtm/NVUtil.h>

#if defined(minor)
#undef minor
#endif

namespace RTC
{
/*!
Expand Down Expand Up @@ -97,7 +101,29 @@ namespace RTC

try
{
::RTC::PortStatus ret(_ptr()->pull(cdr_data.out()));
::RTC::PortStatus ret(::RTC::PortStatus::PORT_ERROR);
try
{
ret = _ptr()->pull(cdr_data.out());
}
#ifdef ORB_IS_OMNIORB
catch (const CORBA::COMM_FAILURE& ex)
{
if (ex.minor() == omni::COMM_FAILURE_WaitingForReply)
{
RTC_DEBUG(("Retry pull message"));
ret = _ptr()->pull(cdr_data.out());
}
else
{
throw;
}
}
#endif
catch (...)
{
throw;
}

if (ret == ::RTC::PORT_OK)
{
Expand Down
Loading