Refactored to have socket settings in constants.py