Commit Graph

280 Commits

Author SHA1 Message Date
James Chen 7d43e35741 Merge branch 'v3' of git://github.com/cocos2d/cocos2d-x into refactor-websocket 2016-02-17 14:56:32 +08:00
mogemimi 44d2a161dc Remove unnecessary c_str() calls 2016-02-04 11:52:14 +09:00
mogemimi 7dd7dfede7 Replace char* with std::string in HttpRequest 2016-01-26 05:13:18 +09:00
James Chen 28a3f78c65 Adds missing <mutex>, <memory> include files in WebSocket.h 2016-01-22 18:10:24 +08:00
James Chen b73b16d425 Adds isDestroy std::share_ptr variable to dectect whether websocket instance was destroyed. 2016-01-22 17:43:30 +08:00
James Chen c3e0edde06 'closed' state has to be set before quit websocket thread. 2016-01-22 16:10:49 +08:00
James Chen a64a789308 _readyState must be set to State::CLOSED and _delegate->onClose(this) must be invoked at the end of WebSocket::close. 2016-01-22 15:20:43 +08:00
James Chen ed9ed6c92f Don't change the behavior of WebSocket::close method. WebSocket::close is an synchronous method before, adds a WebSocket::closeAsync method for asynchronous closing. 2016-01-22 14:22:33 +08:00
James Chen f0066d03d7 whitespace cleanup. 2016-01-13 21:15:48 +08:00
James Chen dacd51c839 More function name renames. createThread -> createWebSocket, quitSubThread -> quitWebSocketThread. 2016-01-13 21:15:48 +08:00
James Chen 649ed67371 Removes lws_get_internal_extensions, adds permessage-deflate extension. 2016-01-13 21:15:48 +08:00
James Chen fc38857e6b LWS_SEND_BUFFER_PRE_PADDING -> LWS_PRE 2016-01-13 21:15:48 +08:00
James Chen 5d1e98340e Updates WebSocket::onSocketCallback & WebSocketTest.js 2016-01-13 21:15:48 +08:00
James Chen 2b5fde79e0 Comment fix & function name fix for WsThreadHelper:
sendMessageToUIThread -> sendMessageToCocosThread
sendMessageToSubThread -> sendMessageToWebSocketThread
joinSubThread -> joinWebSocketThread
2016-01-13 21:15:48 +08:00
James Chen d122784ad4 Adds WebSocket::closeAllConnections() method. 2016-01-13 21:15:48 +08:00
James Chen f9e8ae0f09 WebSocket refactoring, bug fixes, improvements, and passes most Autobahn Test (The most standard WebSocket Protocol Test). 2016-01-13 21:14:38 +08:00
mogemimi 41dd44c75d Fix some typos in docs 2016-01-11 19:23:05 +09:00
XiaoFeng ab0efd933a Merge branch 'v3.10' of https://github.com/cocos2d/cocos2d-x into v3
Conflicts:
	CHANGELOG
	cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp
	tests/js-tests/src/RenderTextureTest/RenderTextureTest.js
2016-01-09 18:01:56 +08:00
Wenhai Lin 168e851cce Fixed WebSocket may automatically disconnected if invoke `send` several times in quick succession on Android. 2015-12-31 10:42:06 +08:00
pandamicro 022bcc24f1 Merge branch 'v3.10' of github.com:cocos2d/cocos2d-x into v3
Conflicts:
	cocos/scripting/js-bindings/manual/chipmunk/js_bindings_chipmunk_manual.cpp
	cocos/scripting/js-bindings/manual/component/CCComponentJS.cpp
	cocos/scripting/js-bindings/manual/js_bindings_opengl.cpp
2015-12-20 22:56:33 +08:00
zilongshanren 8d967982cd Merge pull request #14723 from newnon/v3.10_web_socket_crash_fix
fix web socket crash
2015-12-19 10:11:58 +08:00
Sergey b4f762befa fix include in cocos network module 2015-12-17 11:50:54 +03:00
Sergey a172cce874 fix web socket crash 2015-12-17 11:48:25 +03:00
pandamicro 58902f0711 Fix issue in URLSession:task:didCompleteWithError: 2015-12-16 21:19:46 +08:00
pandamicro ffcf45ef78 Improved solution for Downloader status code issue on iOS 9 2015-12-16 17:45:40 +08:00
pandamicro 7303895866 Improve error message for Downloader and add test case 2015-12-16 15:43:18 +08:00
Wenhai Lin 4fa58602a8 Adds `std::nothrow` to the `new` statements 2015-12-16 14:02:55 +08:00
Ce Zheng 6d58fc05d9 Fix Downloader callback bug on iOS9
On iOS 9 when server returns a response with HTTP status 403 caused the
downloader to callback successfully and saving the error message to the
storage path. This commit adds a check on the HTTP status code and
do failure callback if status code is 4xx or 5xx.
2015-12-15 13:16:24 +09:00
pandamicro 91909081da Merge pull request #14542 from pandemosth/issue_14539
Fix for Issue 14539
2015-12-03 18:47:17 +08:00
Pan Demosthenous ef931b61af correct typo in method name of doDestroy 2015-12-02 15:23:05 +11:00
Pan Demosthenous 528a94d36f fixes a crash in destructor of CCDownloader-apple when completing a data download 2015-12-02 15:21:42 +11:00
Pan Demosthenous 151e7a7a53 CCDownloader-apple : call onTaskFinish when the download session completes for a data task 2015-12-02 15:16:00 +11:00
Ce Zheng ecf94a3dc4 Add a buffer queue to iOS Downloader
Upon calling NSURLSessionDownloadTask's resume, the task's timeout
countdown starts. When the AssetManagerEx starts downloading, it creates
all the tasks all at once and just `resume` upon creation. When the
number of asset files is very large, later tasks tend to end up in
'request timed out -1001' error before they can even start downloading.
This commit adds a buffer queue to prevent all the NSURLSessionTasks to
start all at once.
2015-12-01 17:24:26 +09:00
Ce Zheng d174a98afa Add a buffer queue for Android Downloader to prevent out of memory
When the AssetManagerEx start downloading, it used to create all the
download tasks all at once. When the app has a large number of asset
files, it is likely to crash due to out of memory when creating
threads for each of the download tasks. This commit adds a buffer
queue to the downloader to use the `countOfMaxProcessingTasks`
property from hints, preventing all the tasks from starting all at once.
2015-12-01 16:25:50 +09:00
pandamicro 23f27534f6 Solve a possible memory leak in HttpRequest 2015-11-25 14:03:56 +08:00
Xpol Wan 0b5a3465bc Remove duplicated code by introduce a private doSetResponseCallback. 2015-11-18 17:52:24 +08:00
Xpol Wan b33aa00109 Fixes boring deprecated warning.
I know I duplicated the code but there is no cpp for me to move body into.
2015-11-18 17:47:07 +08:00
XiaoFeng e3c120eef4 Combine Studio change for compatible with 32 bit Mac System 2015-11-16 18:25:26 +08:00
XiaoFeng 139d8b5310 Remove unused code 2015-11-06 10:10:09 +08:00
XiaoFeng 1a56668cd3 Fix "TextureCache Test" in js-test crash under Android 2015-11-06 09:49:19 +08:00
mogemimi 9df30d2454 Fix typos in documentation 2015-10-23 16:59:51 +09:00
XiaoFeng 6beb982665 Adjust code execute order, used a simple and safe way to avoid access fail bug. 2015-10-22 14:36:26 +08:00
XiaoFeng 7e54a91ee6 Fix CCDownloader-curl will crash in js-test
Fix broken image link in TextureCacheTest.js
2015-10-20 16:28:03 +08:00
mogemimi 5993304e06 Fix typos 2015-10-09 17:59:11 +09:00
ZeroHackeR 4cfe139991 Fixing SocketIO - Connect failed after Disconnected
Fixes for issue: https://github.com/cocos2d/cocos2d-x/issues/14077
2015-10-06 13:21:22 +06:30
Dale Stammen 548fc94eb8 added missing std includes 2015-10-02 18:17:11 -07:00
Chris Hannon bd7f90f993 adds initializing value and corrects spelling of variable _endpointseparator
Signed-off-by: Chris Hannon <chris@channon.us>
2015-09-19 20:47:54 -04:00
Chris Hannon e7c2436d85 fixes bug in socketio extension when connecting to socketio servers v1+ (incorrect separator in v1 packet strings)
Signed-off-by: Chris Hannon <chris@channon.us>
2015-09-19 20:31:48 -04:00
Vincent Yang 5eafc93d86 Remove AssetsManager dependence with CRUL. 2015-09-17 16:52:31 +08:00
Vincent Yang ea585f4b7d Fix compile problems. 2015-09-16 09:34:24 +08:00