Use tcdrain() instead of calculating the transmission time manulally