Removed socket as function parameter.