No need to check the port number as this will fail anyway.
Rename variable to indicate that it can be port and socket.