[Quickfix-developers] Closing down a quickfix client safely (avoiding message loss)
Brought to you by:
orenmnero
From: Simeon S. <sim...@gm...> - 2015-10-01 09:44:58
|
Hi, When a quickfix client application is closed (e.g. via ^C), one needs to check the buffers and only quit after all the messages already in the buffers have been processed. If the application quits without checking the message buffers, if there are any messages that have been received but not yet processed (which is not unlikely) then these messages will be lost. In otherwords: void on_quit(void) { // We caught ^C socket_initiator.stop(); // Closes the socket connection while(messages_in_buffers()) { // process msg } } The other option is to persist messages to disk. I would be very grateful if someone could shine some light on the issues above. I am not sure how to block until all messages in the buffers have been processed (the while loop above). Simeon |