07-12-2006 09:18 AM
When I detect WRITE_SUCCESS, WARNING or ERROR I set the return value of my callback to the set listed above excluding the detected state (i.e. if a warning has been detected the returned set of states would be NC_ST_READ_AVAIL | NC_ST_WRITE_SUCCESS | NC_ST_ERROR), which should disable repeated triggering of the callback function. But the callback is retriggered again and again causing deadlock of the calling application.
What may be the problem or is there any other way to control the behaviour of the callback function? Or how to correctly implement a callback with following behaviour:
One solution I can think of is to create global variables enabling individual sections of the callback function and the other is to swap two callback functions each of which would handle one situation (i.e. one for data input and the other for data output).
Regards,
Petr Micek
07-13-2006 01:24 PM
Hi,
The notification function activates for errors allways automatically. You can not disable that.
The write success state is allways set if the write queue is empty, thus whenever you do not write the state is set because the queue should be empty.
You can not have multiple notifications on the same handle. Thus the only chance is, to write on a different port using the wait for state to check the write success, or
using the same port and an object for e specific ID to have a different handle for the wait on write success.
DirkW