Simple socket handling.