Localize socket handling to one thread.