Add support for QoS

requested from issue #3