Tuning TCP-based connections