Add basic socket handling for testing