From f3214998ffa25b601ecd3e8d3d5f0b770e564663 Mon Sep 17 00:00:00 2001 From: Jake Hilton Date: Wed, 21 May 2014 13:58:11 -0600 Subject: [PATCH] Fixed up logic for when a reconnect fails. It was not firing the reconnect failed message. Added a test for this to ensure forward compatibility. --- bin/netconnectionsmart.swc | Bin 12866 -> 12914 bytes .../gearsandcogs/utils/NetConnectionSmart.as | 18 +++++--- .../utils/NetConnectionSmartReconnectTest.as | 43 ++++++++++++++++-- 3 files changed, 51 insertions(+), 10 deletions(-) diff --git a/bin/netconnectionsmart.swc b/bin/netconnectionsmart.swc index 63c7421f5fa5f5ad993bb66d4c3c75af3b83fa49..63eb40562701a16c6cecf1738723bf5fe09361d2 100644 GIT binary patch literal 12914 zcmaL8Q*Ej1KOZ7?t|@K!%~ zV?C+X=e({n*>sDk`)uyEG;tmJOsk7UsS8N!Xl zMGRe4U9KNxdcVOEM1!=>%$VyLniMc66?KeA_BO}Ne7n~^cBiF1a^p&cxU+cNPG@s@ z+)k#aJKbij`$+rf;3yLiM3K?CQnR4=wWUrRwpTlPO4?s09r%90b*h@r{@XPEjBAlR z!&1uQ{i%=?ss#hJeml?Ez1*H)WQU3&;#E|vh6M!-)wTtBJMkyaiYI?IF7L=cNP8Hw zEOk>hx7%^#Pa|j+MQPUB3J;VoA#ybaS6d=n+wY`BRj|+e0K&jDSDHWcs=tj+I|Ff? z6i1sI)!Fb9EMQe9rj>zt4zs0Z)pOhT7Z8Kx(vq{pc=6Q>N!IQx`Lxjz$&IhZP&PI+ z&7S{ui>%6F!*}d`NISI*3S^N-DJCwQy`1QB6~f*RH-udSld%+sVI#`+)g@hh4Kz+i z?HCd@YLF$_qRP1~6eUgg+3aI>0%sX%jN>iT&YS1E^gd1d&6K6nv^7*MYRSlxVyi$^ z#WL72>XqtgQ}Siv*baD{Dv8i4$>N7ss_0+hOx4Sb#jP$bj%G`7hs1m~)u2-uq0^{R8SySBkOroBLI;d) zl6gt!Z(y?nb+Ka0hIPY@#b~5J!XR-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? z!>DQbj@ z1JQ9hExH{zsc;=dv-foxK4lMIQ#H~283QE*A3LU+VeBoK$TY7a4MPK!BXj<9tF}>{ zY9$7it?IO6=VX5qyacd(Mrm2RM0U>o1`&(AXaAOo!WmB2o)bTLorqMWSwG&h)0#Xq z7Gh7GH7t+dnZ3*u78Y8Y)$`Rb7CkK|)3y~p>gz1{Irh1=zto@PY&AOV3$qsZI_>D> zR=c!!8PdKA2F8DrV!R~wLz*}JQJ*Rb z0tNdWtu`b+FI=|d^WH6M+9fn_)jitR{>yd|b>;KokLd$K;3mUKpi+D)Si3>(gt-57 z6@M%g@$OE8ymE!X>> QtPuaH+kdv3{eN!%AGd^mZ2$lO diff --git a/src/com/gearsandcogs/utils/NetConnectionSmart.as b/src/com/gearsandcogs/utils/NetConnectionSmart.as index 97a9f99..ad1c041 100644 --- a/src/com/gearsandcogs/utils/NetConnectionSmart.as +++ b/src/com/gearsandcogs/utils/NetConnectionSmart.as @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . - VERSION: 1.3.3 + VERSION: 1.3.4 DATE: 05/09/2014 ACTIONSCRIPT VERSION: 3.0 DESCRIPTION: @@ -117,7 +117,7 @@ package com.gearsandcogs.utils private static const RTMFP:String = "rtmfp"; private static const RTMP:String = "rtmp"; private static const RTMPT:String = "rtmpt"; - public static const VERSION:String = "NetConnectionSmart v 1.3.3"; + public static const VERSION:String = "NetConnectionSmart v 1.3.4"; public var append_guid:Boolean; public var auto_reconnect:Boolean; @@ -138,6 +138,7 @@ package com.gearsandcogs.utils public var reconnect_count_limit:uint = 10; public var reconnect_max_time_wait:uint = 10; + protected var _connect_string_init:String; protected var _ncTypes:Vector.; private var _connectParams:Array; @@ -145,10 +146,10 @@ package com.gearsandcogs.utils private var _portArray:Array = [443, 80, 1935]; private var _initial_connect_run:Boolean; private var _is_connecting:Boolean; + private var _was_connected:Boolean; private var _ncClient:Object; private var _nc:PortConnection; private var _app_string:String; - private var _connect_string_init:String; private var _guid:String; private var _proxy_type:String = "none"; private var _server_string:String; @@ -339,7 +340,10 @@ package com.gearsandcogs.utils return; if (!is_dirty) + { + _was_connected = false; _nc.was_connected = false; + } _nc.close(); @@ -567,8 +571,7 @@ package com.gearsandcogs.utils dispatchEvent(e); - if (!auto_reconnect || !_nc || !_nc.was_connected || - (e.info.code != "NetConnection.Connect.Closed" && e.info.code != "NetConnection.Connect.Failed")) + if (!auto_reconnect || !_was_connected || (e.info.code != "NetConnection.Connect.Closed" && e.info.code != "NetConnection.Connect.Failed")) return; if (reconnect_count_limit == 0 || (_reconnect_count < reconnect_count_limit)) @@ -629,11 +632,12 @@ package com.gearsandcogs.utils } else if (!connected && curr_connection.connected) { - acceptNc(curr_connection); - handleNetStatus(curr_connection.status); _is_connecting = false; + _was_connected = true; _reconnect_count = 0; _connection_attempt_count = 0; + acceptNc(curr_connection); + handleNetStatus(curr_connection.status); return; } else if (!rejected_connection && curr_connection.rejected) diff --git a/testSrc/com/gearsandcogs/utils/NetConnectionSmartReconnectTest.as b/testSrc/com/gearsandcogs/utils/NetConnectionSmartReconnectTest.as index 457cba5..64fed47 100644 --- a/testSrc/com/gearsandcogs/utils/NetConnectionSmartReconnectTest.as +++ b/testSrc/com/gearsandcogs/utils/NetConnectionSmartReconnectTest.as @@ -12,6 +12,9 @@ package com.gearsandcogs.utils public class NetConnectionSmartReconnectTest extends NetConnectionSmart { + private var valid_connect_server:String = "wowzaec2demo.streamlock.net/vod/"; + private var invalid_connect_server:String = "wowzaec2demo.streamlockbad.net/vod/"; + public function NetConnectionSmartReconnectTest() { super(); @@ -21,7 +24,8 @@ package com.gearsandcogs.utils public function setUp():void { auto_reconnect = true; - connect("wowzaec2demo.streamlock.net/vod/"); + reconnect_count_limit = 1; + connect(valid_connect_server); Async.proceedOnEvent(this, this, NetStatusEvent.NET_STATUS, 60000); } @@ -32,7 +36,7 @@ package com.gearsandcogs.utils } [Test(async)] - public function testDisconnectReconnect():void + public function testDisconnectReconnectSuccess():void { assertTrue(connected); @@ -51,5 +55,38 @@ package com.gearsandcogs.utils assertEquals(e.info.code, NETCONNECTION_CONNECT_SUCCESS); } } + + [Test(async)] + public function testDisconnectReconnectFail():void + { + var ref:NetConnectionSmartReconnectTest = this; + + assertTrue(connected); + + Async.handleEvent(ref, ref, NetStatusEvent.NET_STATUS, handleNetStatusClose, 1000, ref); + + _connect_string_init = invalid_connect_server; + close(true); + assertFalse(connected); + + Async.handleEvent(ref, ref, NetStatusEvent.NET_STATUS, handleNetStatusReconnect, 60000, ref); + + function handleNetStatusClose(e:NetStatusEvent, test:NetConnectionSmartReconnectTest):void + { + assertEquals(NETCONNECTION_CONNECT_CLOSED, e.info.code); + } + function handleNetStatusReconnect(e:NetStatusEvent, test:NetConnectionSmartReconnectTest):void + { + //expect a connection failed first + assertEquals(NETCONNECTION_CONNECT_FAILED, e.info.code); + + //then make sure we get a connection reconnect failed second + Async.handleEvent(ref, ref, NetStatusEvent.NET_STATUS, handleNetStatusReconnectFail, 60000, ref); + } + function handleNetStatusReconnectFail(e:NetStatusEvent, test:NetConnectionSmartReconnectTest):void + { + assertEquals(NETCONNECTION_RECONNECT_FAILED, e.info.code); + } + } } -} +} \ No newline at end of file