Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Commit a0c4408

Browse files
authored
Fix SF 793 for Tango 9 LTS (#320)
(API_AsynReplyNotArrived exception thrown when asyn call response is received in the last 20 ms before the timeout expiration) Link to original ticket: https://sourceforge.net/p/tango-cs/bugs/793
1 parent 4c7b7f2 commit a0c4408

File tree

1 file changed

+42
-30
lines changed

1 file changed

+42
-30
lines changed

cppapi/client/proxy_asyn.cpp

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
static const char *RcsId = "$Id$\n$Name$";
1+
static const char *RcsId = "$Id: proxy_asyn.cpp 30242 2016-10-27 11:48:23Z bourtemb $\n$Name$";
22
//====================================================================================
33
//
44
// cpp - C++ source code file for TANGO api Connection and DeviceProxy
@@ -29,7 +29,7 @@ static const char *RcsId = "$Id$\n$Name$";
2929
// along with Tango. If not, see <http://www.gnu.org/licenses/>.
3030
//
3131
//
32-
// $Revision$
32+
// $Revision: 30242 $
3333
//
3434
//===================================================================================
3535

@@ -576,13 +576,16 @@ DeviceData Connection::command_inout_reply(long id,long call_timeout)
576576

577577
if (i == nb)
578578
{
579-
TangoSys_OMemStream desc;
580-
desc << "Device " << dev_name();
581-
desc << ": Reply for asynchronous call (id = " << id;
582-
desc << ") is not yet arrived" << ends;
583-
ApiAsynNotThereExcept::throw_exception(API_AsynReplyNotArrived,
584-
desc.str(),
585-
"Connection::command_inout_reply");
579+
if (req.request->poll_response() == false)
580+
{
581+
TangoSys_OMemStream desc;
582+
desc << "Device " << dev_name();
583+
desc << ": Reply for asynchronous call (id = " << id;
584+
desc << ") is not yet arrived" << ends;
585+
ApiAsynNotThereExcept::throw_exception(API_AsynReplyNotArrived,
586+
desc.str(),
587+
"Connection::command_inout_reply");
588+
}
586589
}
587590
}
588591

@@ -1407,13 +1410,16 @@ vector<DeviceAttribute> *DeviceProxy::read_attributes_reply(long id,long call_ti
14071410

14081411
if (i == nb)
14091412
{
1410-
TangoSys_OMemStream desc;
1411-
desc << "Device " << device_name;
1412-
desc << ": Reply for asynchronous call (id = " << id;
1413-
desc << ") is not yet arrived" << ends;
1414-
ApiAsynNotThereExcept::throw_exception(API_AsynReplyNotArrived,
1415-
desc.str(),
1416-
"DeviceProxy::read_attributes_reply");
1413+
if (req.request->poll_response() == false)
1414+
{
1415+
TangoSys_OMemStream desc;
1416+
desc << "Device " << device_name;
1417+
desc << ": Reply for asynchronous call (id = " << id;
1418+
desc << ") is not yet arrived" << ends;
1419+
ApiAsynNotThereExcept::throw_exception(API_AsynReplyNotArrived,
1420+
desc.str(),
1421+
"DeviceProxy::read_attributes_reply");
1422+
}
14171423
}
14181424
}
14191425

@@ -1650,13 +1656,16 @@ DeviceAttribute *DeviceProxy::read_attribute_reply(long id,long call_timeout)
16501656

16511657
if (i == nb)
16521658
{
1653-
TangoSys_OMemStream desc;
1654-
desc << "Device " << device_name;
1655-
desc << ": Reply for asynchronous call (id = " << id;
1656-
desc << ") is not yet arrived" << ends;
1657-
ApiAsynNotThereExcept::throw_exception(API_AsynReplyNotArrived,
1658-
desc.str(),
1659-
"DeviceProxy::read_attribute_reply");
1659+
if (req.request->poll_response() == false)
1660+
{
1661+
TangoSys_OMemStream desc;
1662+
desc << "Device " << device_name;
1663+
desc << ": Reply for asynchronous call (id = " << id;
1664+
desc << ") is not yet arrived" << ends;
1665+
ApiAsynNotThereExcept::throw_exception(API_AsynReplyNotArrived,
1666+
desc.str(),
1667+
"DeviceProxy::read_attribute_reply");
1668+
}
16601669
}
16611670
}
16621671

@@ -2265,13 +2274,16 @@ void DeviceProxy::write_attributes_reply(long id,long call_timeout)
22652274

22662275
if (i == nb)
22672276
{
2268-
TangoSys_OMemStream desc;
2269-
desc << "Device " << device_name;
2270-
desc << ": Reply for asynchronous call (id = " << id;
2271-
desc << ") is not yet arrived" << ends;
2272-
ApiAsynNotThereExcept::throw_exception(API_AsynReplyNotArrived,
2273-
desc.str(),
2274-
"DeviceProxy::write_attributes_reply");
2277+
if (req.request->poll_response() == false)
2278+
{
2279+
TangoSys_OMemStream desc;
2280+
desc << "Device " << device_name;
2281+
desc << ": Reply for asynchronous call (id = " << id;
2282+
desc << ") is not yet arrived" << ends;
2283+
ApiAsynNotThereExcept::throw_exception(API_AsynReplyNotArrived,
2284+
desc.str(),
2285+
"DeviceProxy::write_attributes_reply");
2286+
}
22752287
}
22762288
}
22772289

0 commit comments

Comments
 (0)