Replace with socket implementation