Added support for multiple threads to send data.