Retrieve all bucket documents from Couchbase server

I am unsure what you mean here. By design the specific port applications should connect to are hidden by the SDK. You shouldn’t specify explicit ports or hosts anywhere in your code. You should only specify an explicit host (or set of hosts) during the initial bootstrap when you pass them in the connection string. These hosts are the bootstrap hosts, and any one of these hosts will be used during the initial lcb_connect() call to gather information about the rest of the cluster. This will give the SDK the information about which services are available on the cluster, and what their locations (host and port) are.