Remove trailing delimiter on both udp and tcp