If the user passes a string (an IP), the socket module would throw an error because there is no tuple. It would be best to fall back to 0 (default port), no?