From 5b51f3c78fbb1c99fdeeeb342cedf1cce5cadd9d Mon Sep 17 00:00:00 2001 From: Simeon Bateman Date: Tue, 22 Feb 2011 18:01:06 -0800 Subject: Updated WebSocket.as to use interface instead of implementation class. Updated WebSocketMain to implement IWebSocketWrapper. Created IWebSocketWrapper --- flash-src/IWebSocketWrapper.as | 10 ++++++++++ flash-src/WebSocket.as | 4 ++-- flash-src/WebSocketMain.as | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 flash-src/IWebSocketWrapper.as diff --git a/flash-src/IWebSocketWrapper.as b/flash-src/IWebSocketWrapper.as new file mode 100644 index 0000000..06bebcd --- /dev/null +++ b/flash-src/IWebSocketWrapper.as @@ -0,0 +1,10 @@ +package { + + public interface IWebSocketWrapper { + function getOrigin():String; + function getCallerHost():String; + function log(message:String):void; + function fatal(message:String):void; + function error(message:String):void; + } +} \ No newline at end of file diff --git a/flash-src/WebSocket.as b/flash-src/WebSocket.as index 0733570..130a086 100644 --- a/flash-src/WebSocket.as +++ b/flash-src/WebSocket.as @@ -34,7 +34,7 @@ public class WebSocket extends EventDispatcher { private var tlsSocket:TLSSocket; private var tlsConfig:TLSConfig; private var socket:Socket; - private var main:WebSocketMain; + private var main:IWebSocketWrapper; private var url:String; private var scheme:String; private var host:String; @@ -51,7 +51,7 @@ public class WebSocket extends EventDispatcher { private var expectedDigest:String; public function WebSocket( - main:WebSocketMain, url:String, protocol:String, + main:IWebSocketWrapper, url:String, protocol:String, proxyHost:String = null, proxyPort:int = 0, headers:String = null) { this.main = main; diff --git a/flash-src/WebSocketMain.as b/flash-src/WebSocketMain.as index 9d6ff90..6dc0517 100644 --- a/flash-src/WebSocketMain.as +++ b/flash-src/WebSocketMain.as @@ -17,7 +17,7 @@ import mx.events.*; import mx.utils.*; import bridge.FABridge; -public class WebSocketMain extends Sprite { +public class WebSocketMain extends Sprite implements IWebSocketWrapper{ private var callerUrl:String; private var debug:Boolean = false; -- cgit v1.2.1 From 4439ab0133af11d040a259ac6ce78b3e554253c0 Mon Sep 17 00:00:00 2001 From: Simeon Bateman Date: Tue, 22 Feb 2011 18:16:34 -0800 Subject: updated build script to create WebSocket.swc library file --- flash-src/build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flash-src/build.sh b/flash-src/build.sh index 32fa6b3..80307ab 100755 --- a/flash-src/build.sh +++ b/flash-src/build.sh @@ -5,6 +5,9 @@ mxmlc -static-link-runtime-shared-libraries -target-player=10.0.0 -output=../WebSocketMain.swf WebSocketMain.as && mxmlc -static-link-runtime-shared-libraries -output=../WebSocketMainInsecure.swf WebSocketMainInsecure.as && +compc -source-path . -include-classes WebSocket IWebSocketWrapper -output=../WebSocket.swc && cd .. && -zip WebSocketMainInsecure.zip WebSocketMainInsecure.swf && -rm WebSocketMainInsecure.swf +zip WebSocketMainInsecure.zip WebSocketMainInsecure.swf WebSocket.swc && +rm WebSocketMainInsecure.swf && +rm WebSocket.swc + -- cgit v1.2.1 From 02f4352ec60666098807e6a9a9be12ad15c9979d Mon Sep 17 00:00:00 2001 From: Simeon Bateman Date: Tue, 22 Feb 2011 18:17:09 -0800 Subject: updated binary files --- WebSocketMain.swf | Bin 180025 -> 180118 bytes WebSocketMainInsecure.zip | Bin 172831 -> 419496 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/WebSocketMain.swf b/WebSocketMain.swf index a750da6..0304ed8 100644 Binary files a/WebSocketMain.swf and b/WebSocketMain.swf differ diff --git a/WebSocketMainInsecure.zip b/WebSocketMainInsecure.zip index ad1d8d0..2f8b317 100644 Binary files a/WebSocketMainInsecure.zip and b/WebSocketMainInsecure.zip differ -- cgit v1.2.1 From 0dca2ea48030cf0bdabc1c140892dda6df3ec25e Mon Sep 17 00:00:00 2001 From: Simeon Bateman Date: Tue, 22 Feb 2011 18:22:26 -0800 Subject: changed build to not removed swc --- flash-src/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flash-src/build.sh b/flash-src/build.sh index 80307ab..3a37cf2 100755 --- a/flash-src/build.sh +++ b/flash-src/build.sh @@ -8,6 +8,6 @@ mxmlc -static-link-runtime-shared-libraries -output=../WebSocketMainInsecure.swf compc -source-path . -include-classes WebSocket IWebSocketWrapper -output=../WebSocket.swc && cd .. && zip WebSocketMainInsecure.zip WebSocketMainInsecure.swf WebSocket.swc && -rm WebSocketMainInsecure.swf && -rm WebSocket.swc +rm WebSocketMainInsecure.swf + -- cgit v1.2.1 From 97921866913b472b40428a6f327a3e3b5616c159 Mon Sep 17 00:00:00 2001 From: Simeon Bateman Date: Tue, 22 Feb 2011 18:22:47 -0800 Subject: updating binary files --- WebSocket.swc | Bin 0 -> 246314 bytes WebSocketMain.swf | Bin 180118 -> 180117 bytes WebSocketMainInsecure.zip | Bin 419496 -> 419443 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 WebSocket.swc diff --git a/WebSocket.swc b/WebSocket.swc new file mode 100644 index 0000000..92ff58f Binary files /dev/null and b/WebSocket.swc differ diff --git a/WebSocketMain.swf b/WebSocketMain.swf index 0304ed8..53f1b81 100644 Binary files a/WebSocketMain.swf and b/WebSocketMain.swf differ diff --git a/WebSocketMainInsecure.zip b/WebSocketMainInsecure.zip index 2f8b317..7016ab4 100644 Binary files a/WebSocketMainInsecure.zip and b/WebSocketMainInsecure.zip differ -- cgit v1.2.1