Do we ever find out, anywhere in Star Trek, whether standard-issue Starfleet communicators (e.g. TOS-era handheld communicators or TNG-era commbadges) require a server to communicate (like a cell phone), or whether they are capable of direct peer-to-peer signaling, without the intervention of any server/trunked system (e.g. based on a starship, satellite, land base station, etc.)?
For example, if two Starfleet officers were stranded an arbirary distance from Federation resources, without anything except the clothes on their backs and their commbadges, could they communicate with each other over a reasonable distance, or would they get "no service" error messages or similar?
If a Starfleet communicator can be reconfigured on the fly to serve as a server/hub for communicator networking, that counts as an answer (e.g. "Our ship just blew up and we are alone, so let's reset our communicators to not depend on our lost ship. Lt. Jones, tap the code onto your communicator to set it to Server Mode, and everyone else sync to his").