Greatly improve tcp example