replace current socket handling with uv error handling