O'Reilly logo

Unity Multiplayer Games by Alan Stagner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How PubNub works

As mentioned earlier, PubNub works over HTTP rather than TCP or UDP sockets. This means, the PubNub service is entirely interacted with via a web service. How does this work?

There are two URLs which form all interactions with PubNub. One is used for publishing. You request this URL and pass all information such as Publish key, Subscribe key, the channel to publish on, and the message to publish, and so on.

The other URL is used for subscribing. For the best latency, you make a request to this URL, and as soon as it returns something you make another request, and so on. Unlike most web requests, this URL has an especially long time out, and won't return anything until somebody else publishes a message on that channel. That means ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required