def _is_port_in_use(self) -> bool:
        """Check if the port is in use."""
        try:
            # Faster method to check port availability
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            sock.settimeout(0.2)  # Reduce timeout for faster checks
            result = sock.connect_ex((self.host, self.port))
            sock.close()
            return result == 0
        except Exception:
            # Fallback to the original method
            with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
                return sock.connect_ex((self.host, self.port)) == 0
Check if the port is in use.
src/upsonic/server_manager.py