Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changed xdr to xdr http client, added option to used either tcp socke…

…ts or http client, default is http client
  • Loading branch information...
commit e4fb5332a6e81c548533012726e7774d783b4527 1 parent 2f8009c
@devendram devendram authored
View
7 titanium/3.3/mobile/detailed-history-example-app/Resources/pubnub.js
@@ -254,9 +254,7 @@ function xdr_tcp(setup) {
* fail : function() {}
* });
*/
-function xdr( setup ) {
-
- if(setup.native_tcp_socket == true) return xdr_tcp(setup);
+function xdr_http_client( setup ) {
var url = setup.url.join(URLBIT);
if (setup.data) {
@@ -334,6 +332,7 @@ var DEMO = 'demo'
, ORIGIN = 'http' + SSL + '://' +
(setup['origin'] || 'pubsub.pubnub.com')
, UUID = setup['uuid'] || db.get(SUBSCRIBE_KEY+'uuid') || ''
+ , xdr = setup['native_tcp_socket'] ? xdr_tcp : xdr_http_client
, SELF = {
/*
PUBNUB.history({
@@ -350,7 +349,7 @@ var DEMO = 'demo'
// Make sure we have a Channel
if (!channel) return log('Missing Channel');
if (!callback) return log('Missing Callback');
-
+
// Send Message
xdr({
url : [
View
7 titanium/3.3/mobile/here-now-example-app/Resources/pubnub.js
@@ -254,9 +254,7 @@ function xdr_tcp(setup) {
* fail : function() {}
* });
*/
-function xdr( setup ) {
-
- if(setup.native_tcp_socket == true) return xdr_tcp(setup);
+function xdr_http_client( setup ) {
var url = setup.url.join(URLBIT);
if (setup.data) {
@@ -334,6 +332,7 @@ var DEMO = 'demo'
, ORIGIN = 'http' + SSL + '://' +
(setup['origin'] || 'pubsub.pubnub.com')
, UUID = setup['uuid'] || db.get(SUBSCRIBE_KEY+'uuid') || ''
+ , xdr = setup['native_tcp_socket'] ? xdr_tcp : xdr_http_client
, SELF = {
/*
PUBNUB.history({
@@ -350,7 +349,7 @@ var DEMO = 'demo'
// Make sure we have a Channel
if (!channel) return log('Missing Channel');
if (!callback) return log('Missing Callback');
-
+
// Send Message
xdr({
url : [
View
7 titanium/3.3/mobile/presence-example-app/Resources/pubnub.js
@@ -254,9 +254,7 @@ function xdr_tcp(setup) {
* fail : function() {}
* });
*/
-function xdr( setup ) {
-
- if(setup.native_tcp_socket == true) return xdr_tcp(setup);
+function xdr_http_client( setup ) {
var url = setup.url.join(URLBIT);
if (setup.data) {
@@ -334,6 +332,7 @@ var DEMO = 'demo'
, ORIGIN = 'http' + SSL + '://' +
(setup['origin'] || 'pubsub.pubnub.com')
, UUID = setup['uuid'] || db.get(SUBSCRIBE_KEY+'uuid') || ''
+ , xdr = setup['native_tcp_socket'] ? xdr_tcp : xdr_http_client
, SELF = {
/*
PUBNUB.history({
@@ -350,7 +349,7 @@ var DEMO = 'demo'
// Make sure we have a Channel
if (!channel) return log('Missing Channel');
if (!callback) return log('Missing Callback');
-
+
// Send Message
xdr({
url : [
View
7 titanium/3.3/mobile/pubnub.js
@@ -254,9 +254,7 @@ function xdr_tcp(setup) {
* fail : function() {}
* });
*/
-function xdr( setup ) {
-
- if(setup.native_tcp_socket == true) return xdr_tcp(setup);
+function xdr_http_client( setup ) {
var url = setup.url.join(URLBIT);
if (setup.data) {
@@ -334,6 +332,7 @@ var DEMO = 'demo'
, ORIGIN = 'http' + SSL + '://' +
(setup['origin'] || 'pubsub.pubnub.com')
, UUID = setup['uuid'] || db.get(SUBSCRIBE_KEY+'uuid') || ''
+ , xdr = setup['native_tcp_socket'] ? xdr_tcp : xdr_http_client
, SELF = {
/*
PUBNUB.history({
@@ -350,7 +349,7 @@ var DEMO = 'demo'
// Make sure we have a Channel
if (!channel) return log('Missing Channel');
if (!callback) return log('Missing Callback');
-
+
// Send Message
xdr({
url : [
Please sign in to comment.
Something went wrong with that request. Please try again.