Modified PubNub library to better utilize low bandwidth connections like a GSM modem. Instead of 10 socket connections sending 3 bytes only one is made and it sends all 30 bytes at the same time.

Fork of PubNub by PubNub

Revision:
3:36f064f7bdf0
Parent:
2:d78239c9ebb8
Child:
4:a4759c403023
--- a/PubNub.h	Sun Mar 02 01:43:20 2014 +0000
+++ b/PubNub.h	Sun Mar 02 01:47:11 2014 +0000
@@ -90,16 +90,20 @@
     
     ~PubNub();
 
-    /** Publish
+    /** Publish API call
      *
      * Send a message (assumed to be well-formed JSON) to a given channel.
      *
      * Examples:
+     * @code
          p.publish("demo", "\"lala\"");
+     * @endcode
      * or
+     * @code
          if (p.publish("demo", "{\"lala\":1}") != PNR_OK) {
            blink_error();
          }
+     * @endcode
      *
      * @param channel required channel name.
      * @param message required JSON message object.
@@ -107,7 +111,7 @@
      * @return PNR_OK on success. */
     PubNubRes publish(const char *channel, const char *message, char **reply = NULL);
 
-    /** Subscribe
+    /** Subscribe API call
      *
      * Listen for a message on a given channel. The function will block
      * and return when a message arrives. Typically, you will run this
@@ -128,6 +132,7 @@
      * before waiting for new data from the server.
      *
      * Examples:
+     * @code
          while (1) {
              char *reply;
              if (p.subscribe("demo", &reply) != PNR_OK) continue;
@@ -136,6 +141,7 @@
              if (sscanf(reply, "{\"code\":%d}", &code) == 1)
                printf("received JSON msg with code %d\n", code);
          }
+     * @endcode
      *
      * @param channel required channel name.
      * @param reply required pointer for passing the returned reply (do not free()).
@@ -144,7 +150,7 @@
 
     /* TODO: subscribe_multi */
 
-    /** History
+    /** History API call
      *
      * Receive list of the last N messages on the given channel.
      *
@@ -154,6 +160,7 @@
      * can be NULL if there is no history for this channel.
      *
      * Example:
+     * @code
         char *reply;
         int replysize;
         if (p.history("demo", &reply, &replysize) != PNR_OK) return;
@@ -161,6 +168,7 @@
         for (char *msg = reply; msg < reply + replysize; msg += strlen(msg)+1)
             printf("historic message: %s", msg);
         free(reply);
+     * @endcode
      *
      * @param channel required channel name.
      * @param reply required pointer for passing the returned reply (free() after use).
@@ -169,7 +177,7 @@
      * @return PNR_OK on success. */
     PubNubRes history(const char *channel, char **reply, int *replysize, int limit = 10);
     
-    /** Time
+    /** Time API call
      *
      * Receive the current server timestamp and store it in the
      * provided string buffer (a char[32] or larger).