Redesign tcp interface without callbacks