Hi! Good point. The reason behind this was not to change any code that is not in my #ifdef.
But I can implement it too by adding an #ifdef-#else block around the two invocations of tcp_connect(). Would that be an improvement in your eyes? (Less copied code)