def is_available(self):
if self.scheme in NOOP_PROTOCOLS:<EOL><INDENT>return True<EOL><DEDENT>if not self.port:<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>s = socket.socket()<EOL>try:<EOL><INDENT>s.connect((self.host, self.port))<EOL><DEDENT>except Exception:<EOL><INDENT>return False<EOL><DEDENT>else:<EOL><INDENT>return True<EOL><DEDENT>
Return True if the connection to the host and port is successful.

@return: bool