diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 655cfeca98..a517b2ee72 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -570,7 +570,13 @@ void WebSocket::onSubThreadStarted() { "permessage-deflate", lws_extension_callback_pm_deflate, + // iOS doesn't support client_no_context_takeover extension in the current version, it will cause iOS connection fail + // It may be a bug of lib websocket iOS build +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + "permessage-deflate; client_max_window_bits" +#else "permessage-deflate; client_no_context_takeover; client_max_window_bits" +#endif }, { "deflate-frame", diff --git a/tests/js-tests/project/proj.ios/Info.plist b/tests/js-tests/project/proj.ios/Info.plist index 2a4c9dabd3..f429bb974d 100644 --- a/tests/js-tests/project/proj.ios/Info.plist +++ b/tests/js-tests/project/proj.ios/Info.plist @@ -17,6 +17,15 @@ NSTemporaryExceptionMinimumTLSVersion TLSv1.1 + itharbors.com + + NSIncludesSubdomains + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + NSTemporaryExceptionMinimumTLSVersion + TLSv1.1 + CFBundleDevelopmentRegion diff --git a/tests/js-tests/src/ExtensionsTest/NetworkTest/SocketIOTest.js b/tests/js-tests/src/ExtensionsTest/NetworkTest/SocketIOTest.js index 8ac2427f32..b5f9f517ea 100644 --- a/tests/js-tests/src/ExtensionsTest/NetworkTest/SocketIOTest.js +++ b/tests/js-tests/src/ExtensionsTest/NetworkTest/SocketIOTest.js @@ -125,8 +125,14 @@ var SocketIOTestLayer = cc.Layer.extend({ }, onExit: function() { - if(this._sioEndpoint) this._sioEndpoint.disconnect(); - if(this._sioClient) this._sioClient.disconnect(); + if(this._sioEndpoint) { + this._sioEndpoint.disconnect(); + this._sioEndpoint = null; + } + if(this._sioClient) { + this._sioClient.disconnect(); + this._sioClient = null; + } this._super(); }, @@ -153,7 +159,7 @@ var SocketIOTestLayer = cc.Layer.extend({ onMenuSIOClientClicked: function(sender) { //create a client by using this static method, url does not need to contain the protocol - var sioclient = SocketIO.connect("ws://cocos2d-x.org/assets/cpp-tests-resources:4000", {"force new connection" : true}); + var sioclient = SocketIO.connect("ws://tools.itharbors.com:4000", {"force new connection" : true}); //if you need to track multiple sockets it is best to store them with tags in your own array for now sioclient.tag = "Test Client"; @@ -193,7 +199,7 @@ var SocketIOTestLayer = cc.Layer.extend({ onMenuSIOEndpointClicked: function(sender) { //repeat the same connection steps for the namespace "testpoint" - var sioendpoint = SocketIO.connect("ws://cocos2d-x.org/assets/cpp-tests-resources:4000/testpoint", {"force new connection" : true}); + var sioendpoint = SocketIO.connect("ws://tools.itharbors.com:4000/testpoint", {"force new connection" : true}); //a tag to differentiate in shared callbacks sioendpoint.tag = "Test Endpoint"; @@ -254,14 +260,18 @@ var SocketIOTestLayer = cc.Layer.extend({ onMenuTestClientDisconnectClicked: function(sender) { - if(this._sioClient != null) this._sioClient.disconnect(); - + if(this._sioClient != null) { + this._sioClient.disconnect(); + this._sioClient = null; + } }, onMenuTestEndpointDisconnectClicked: function(sender) { - if(this._sioEndpoint != null) this._sioEndpoint.disconnect(); - + if(this._sioEndpoint != null) { + this._sioEndpoint.disconnect(); + this._sioEndpoint = null; + } }, toExtensionsMainLayer: function (sender) { diff --git a/tools/tojs/genbindings.py b/tools/tojs/genbindings.py index 22d871bcb0..04ce8eb0bc 100755 --- a/tools/tojs/genbindings.py +++ b/tools/tojs/genbindings.py @@ -76,14 +76,20 @@ def main(): sys.exit(1) if platform == 'win32': - x86_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.4/prebuilt', '%s' % cur_platform)) + x86_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.5/prebuilt', '%s' % cur_platform)) + if not os.path.exists(x86_llvm_path): + x86_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.4/prebuilt', '%s' % cur_platform)) if not os.path.exists(x86_llvm_path): x86_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.3/prebuilt', '%s' % cur_platform)) else: - x86_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.4/prebuilt', '%s-%s' % (cur_platform, 'x86'))) + x86_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.5/prebuilt', '%s-%s' % (cur_platform, 'x86'))) + if not os.path.exists(x86_llvm_path): + x86_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.4/prebuilt', '%s-%s' % (cur_platform, 'x86'))) if not os.path.exists(x86_llvm_path): x86_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.3/prebuilt', '%s-%s' % (cur_platform, 'x86'))) - x64_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.4/prebuilt', '%s-%s' % (cur_platform, 'x86_64'))) + x64_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.5/prebuilt', '%s-%s' % (cur_platform, 'x86_64'))) + if not os.path.exists(x64_llvm_path): + x64_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.4/prebuilt', '%s-%s' % (cur_platform, 'x86_64'))) if not os.path.exists(x64_llvm_path): x64_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.3/prebuilt', '%s-%s' % (cur_platform, 'x86_64'))) @@ -110,7 +116,9 @@ def main(): config.set('DEFAULT', 'cxxgeneratordir', cxx_generator_root) config.set('DEFAULT', 'extra_flags', '') - if '3.4' in llvm_path: + if '3.5' in llvm_path: + config.set('DEFAULT', 'clang_version', '3.5') + elif '3.4' in llvm_path: config.set('DEFAULT', 'clang_version', '3.4') else: config.set('DEFAULT', 'clang_version', '3.3') @@ -129,6 +137,7 @@ def main(): # set proper environment variables if 'linux' in platform or platform == 'darwin': os.putenv('LD_LIBRARY_PATH', '%s/libclang' % cxx_generator_root) + print '%s/libclang' % cxx_generator_root if platform == 'win32': path_env = os.environ['PATH'] os.putenv('PATH', r'%s;%s\libclang;%s\tools\win32;' % (path_env, cxx_generator_root, cxx_generator_root))