Commit Graph

37 Commits

Author SHA1 Message Date
James Chen 68be4dbbaf Fix potential crash after WebSocket.close.
Since the finalize function will get a invalid pointer of WebSocket, invoking ws->closeAysnc() will generate unknown result, probably crash.
HOW TO FIX:
WebSocket and JSB_WebSocketDelegate inhert from Ref. After websocket is initialized successfully, retain websocket instance and delegate, they will both have 2 reference count.
release their reference both in onClose callback and finalize function. The reason is that the order of invoking onClose and finalize function will be unpredictable, ref count technique help to handle this.

Another fix is sending onclose event after onerror is received.
2017-07-20 16:43:24 +08:00
Nan Wang ed08907c1e fix websocket include 2017-07-06 11:07:10 +08:00
James Chen da17c672c1 fixes include in WebSocket-libwebsockets.cpp. 2017-07-05 18:06:44 +08:00
Wang Nan e9617ca0a6 Merge pull request #685 from dumganhar/fix/socketrocket
Uses SocketRocket to implement WebSocket for iOS
2017-07-05 17:55:46 +08:00
James Chen 1ba17074d1 Uses SocketRocket to implement WebSocket for iOS. It has the following benefits:
1. The API of SocketRocket is easy for use, it's all asynchronous API.
2. No need to deal with thread communications, it's wrapped inside SocketRocket.
3. Network status change will not make connection closed, it just seems there isn't any status change.
4. Locking screen will trigger an error while libwebsockets or bsd socket will not.
5. Don't depend on openssl library which is a little big.
6. Don't need to use a local CA root certificate (curl ca file is over 2MB) for wss connection
7. Don't trigger signal pipe while closing wss connection
8. Easy to integrate SocketRocket to current WebSocket implementation
2017-07-05 16:32:57 +08:00
pandamicro d300701125 Fix android sub module dependency issue 2017-07-04 16:35:42 +08:00
James Chen fc98b4bdc0 Sync with cocos2d-x v3 branch ddb4dc8 commit. 2017-04-24 10:49:02 +08:00
James Chen 779cc28217 Sync from https://github.com/cocos2d/cocos2d-x/pull/17381 2017-02-20 10:46:28 +08:00
James Chen 92c0b0e5dc Updates license year. 2017-02-16 11:17:32 +08:00
James Chen 2b459eaf36 Synchronizes changes in https://github.com/cocos2d/cocos2d-x/pull/17342 2017-02-16 11:15:45 +08:00
James Chen 18537b6a8a Updates project configuration for win32 and assert logic fix for HttpClient. 2017-02-16 11:13:31 +08:00
James Chen 31326476c7 Updates WebSocket.cpp/h to support wss. 2017-02-16 11:13:31 +08:00
pandamicro 1da6a0e5ae Revert Network modifications 2017-02-06 12:37:44 +08:00
pandamicro cec9760bd0 Fix websocket cycling destructor issue 2017-01-22 18:43:32 +08:00
pandamicro bc915ddc44 Add Downloader bindings 2017-01-16 13:57:10 +08:00
pandamicro c47a770877 Adapt websocket to new memory model 2017-01-06 16:59:40 +08:00
pandamicro 9bf561baee Upgrade to v3.13 release 2016-08-26 14:30:32 +08:00
pandamicro 1dd701936b Fix compilation issues on Mac 2016-08-11 13:57:51 +08:00
pandamicro bcbc4e1131 Upgrade cocos/math & cocos/network to v3.13 2016-08-05 18:13:16 +08:00
Nan Wang 6afe3f0b5d revert websocket change to support ipv6 network. 2016-07-27 18:12:19 +08:00
Wenhai Lin 14d3fc1fdb Fixed crash 2016-05-20 11:52:13 +08:00
pandamicro cac05f6128 Add AssetsManagerEx to extension 2016-05-18 15:21:56 +08:00
Wenhai Lin 5dcd5ed979 Use const references whenever possible 2016-05-18 14:26:43 +08:00
knoxHuang 3e79d5cab9 fix WebSocket bug for JSB 2016-05-18 10:09:43 +08:00
Wenhai Lin 850c479516 Sync Bug fix:
1. HttpClient: remove Content-Type limitation
2.VideoPlayer/WebView: hide system native control when the Node leaves the 'stage'
2016-05-12 14:26:28 +08:00
Wenhai Lin d4481bfd5a Refine (#48) 2016-04-28 11:58:34 +08:00
Wenhai Lin 6da52bccad Refine Websocket 2016-04-27 14:16:02 +08:00
Wenhai Lin 94501cc8f1 Bug fix and stability improvements 2016-04-25 15:56:03 +08:00
Wenhai Lin 83fc6fd1a8 Bug fix:
1.Fixed crash in win for rich text
2.Fixed crash when custom SSL certificate is set on iOS
3.Fixed SocketIO crash on reconnect
4.Fixed ActionManager memory leak
5.Fixed crash in MenuItem::activate
6.Fixed crash on exit game
7.Fixed crash in TableView::updateCellAtIndex
8.Fixed crash in RichText on window
2016-04-21 15:19:47 +08:00
Wenhai Lin e6e2d22724 Bug fix:
1.Downloader crash when storage path contains spaces on iOS
2.Memory leak when read empty file
3.Actions may not have been executed
4.TMXXMLParser::TMXObjectInfo support "id" key
2016-04-19 16:33:21 +08:00
Wenhai Lin b9680ea88f Fixed crash on android 2016-04-08 15:46:47 +08:00
Wenhai Lin ec1a1d65b7 Remove unnecessary 'void' modifier 2016-04-07 23:13:19 +08:00
Wenhai Lin e4b8db424a Withespaces does matter. 2016-04-07 21:56:30 +08:00
Wenhai Lin 34939f30fd sync bug fix++ 2016-04-07 21:56:09 +08:00
Wenhai Lin 94c95d5838 Withespaces does matter. 2016-03-31 23:50:02 +08:00
Wenhai Lin 8257556bc5 Fixed compile errors and warnings 2016-03-30 17:13:15 +08:00
Wenhai Lin a6dbf31dcf cocos 2d lite version 2016-03-29 17:55:48 +08:00