Added the ability to send data at given times and added a thread for sending.