Browse files

(if more than 1) are fired to the callback (CL-3003317468170)

  • Loading branch information...
1 parent 2394676 commit 41527a11d5cf7631a89e6152dcfcc74fc0f78622 @fmaxx fmaxx committed Jan 16, 2013
Showing with 10 additions and 5 deletions.
  1. +1 −1 flash/3.4/src/com/pubnub/Settings.as
  2. +9 −4 flash/3.4/src/com/pubnub/subscribe/Subscribe.as
View
2 flash/3.4/src/com/pubnub/Settings.as
@@ -15,7 +15,7 @@ package com.pubnub {
// ie, 100 times, every 3 seconds for a network connection
// time in millseconds to wait for web server to return a response. DO NOT CHANGE unless requested by support
- public static const OPERATION_TIMEOUT:uint = 10000;
+ public static const OPERATION_TIMEOUT:uint = 310000;
// for wait a response of a ping operation with [PING_OPERATION_URL], ms
public static const PING_OPERATION_TIMEOUT:uint = 2000;
View
13 flash/3.4/src/com/pubnub/subscribe/Subscribe.as
@@ -228,7 +228,6 @@ package com.pubnub.subscribe {
/*---------------------------SUBSCRIBE---------------------------*/
private function doSubscribe():void {
- //trace('doSubscribe');
var operation:Operation = getOperation(SUBSCRIBE);
connection.sendOperation(operation);
}
@@ -246,9 +245,9 @@ package com.pubnub.subscribe {
}
var messages:Array = responce[0] as Array;
-
_lastToken = responce[1];
var chStr:String = responce[2];
+
/*
* MX (array.length = 3)
* responce = [['m1', 'm2', 'm3', 'm4'], lastToken, ['ch1', 'ch2', 'ch2', 'ch3']];
@@ -277,12 +276,18 @@ package com.pubnub.subscribe {
channel = chArray[i];
var message:* = messages[i]
if (hasChannel(channel)) {
- dispatchEvent(new SubscribeEvent(SubscribeEvent.DATA, {channel:channel, message : message}));
+ dispatchEvent(new SubscribeEvent(SubscribeEvent.DATA, {
+ channel:channel,
+ message : message}));
}
}
}else {
channel = chStr || _channels[0];
- dispatchEvent(new SubscribeEvent(SubscribeEvent.DATA, {channel:channel, message : messages}));
+ for (var j:int = 0; j < messages.length; j++) {
+ dispatchEvent(new SubscribeEvent(SubscribeEvent.DATA, {
+ channel:channel,
+ message : messages[j]}));
+ }
}
}
doSubscribe();

0 comments on commit 41527a1

Please sign in to comment.