Socket refactoring: Decreased complexity of the transmit functions