# Sniffer Callback

When `mco_db_sniffer()` is called it must pass a callback function defined as follows:

        typedef MCO_RET (*mco_sniffer_callback_t) (mco_db_h db, void* context, mco_trans_counter_t trans_no);

The parameters are as follows:

db | A valid database connection handle.
context | A user-defined connection context. (This is normally opaque data of size MCO_CFG_CONNECTION_CONEXT_SIZE provided by function `mco_db_connect_ctx()`.
trans_no | The number of the active transaction (0 if there is no active transaction). (This is additional information that could help detect a hung transaction which could signify a dead connection.)

An example of a sniffer implementation is provided in the SDK sample "samples/native/core/19-recovery/sniffer".