Scheduler and tcp message receptions in the same thread (correct a bug in)