When a client subscribes to a channel using PubNub, it establishes a long-lived HTTP connection to listen for messages. This process, called long polling, works as follows:
- PubNub SDK sends a request to the PubNub network with a list of channels to subscribe.
- The request remains open until a message is received on any of the subscribed channels.
- When a message is sent to one of those channels, PubNub responds with the message data and a 200 OK status.
- After receiving a response, PubNub SDK immediately issues a new subscribe request to continue listening for messages.
- If no messages arrive within the subscribe timeout, PubNub responds with an empty response and a 200 OK status, and the SDK initiates a new subscribe request.
This cycle repeats continuously, ensuring the client always has an open connection to receive messages in real-time.

See also: