Use tcdrain() instead of calculating the transmission time manually