Hi all,
I am new to cocos2d-js. I use the Asset Manager to download new and updated assets. After completing the downloading, i need to restart the game by calling cc.game.restart() and then i got an error message of “Address already in use”.
Any ideas?
Thanks u,
Do you have any screen shot to show the error ? I never seen this message: “Address already in use”
@pandamicro, kindly thanks u for ur reply.
I use the wrong word. It is not the error, actually it is log message “Address already in use”. But i still have the problem with asset manager.
My scenario: i use “cocos2d-js-v3.6.1” and run the sample code “js-tests” and then i tested the “Asset Manager” that download 3 dynamic scenes and at the last scene, cc.game.restart() is called and then i got the log message like the attachment.
Another error message appears: jsb: ERROR: File /Users/hujiang/…
log_cocos2d_js_asset_mng.txt.zip (5.2 KB)
Thanks u,
jsb: ERROR: File /Users/hujiang/Documents/cocostupdate/PrebuiltRuntimeJs/frameworks/js-bindings/bindings/auto/jsb_cocos2dx_extension_auto.cpp: Line: 7287, Function: js_cocos2dx_extension_AssetsManagerEx_getLocalManifest
js_cocos2dx_extension_AssetsManagerEx_getLocalManifest : Invalid Native Object
JS: /Users/touchhean/Dragon/Tutorial/Cocos2d/test/Catalogue/runtime/mac/PrebuiltRuntimeJs.app/../../../src/ExtensionsTest/AssetsManagerTest/AssetsManagerTest.js:172:Error: js_cocos2dx_extension_AssetsManagerEx_getLocalManifest : Invalid Native Object
The important error message is this, it indicates that your AssetsManager object have been released while getLocalManifest is called.
This code is the sample from “samples/js-tests” of the cocos2d-js, i do no update. By the way, “this._am.retain();” is found in the AssetsManagerTest.js on line of 129 . So the “_am” asset manager should be retained.
Any ideas?
Thanks u,
i dont know what is : “cc.game.restart()”
but its defently looks familure from networking
just run in terminal
netstat -a
and it will give you the ports that are used , this is in Linux / mac / GNU utilities for Win32 .
also for windows yo have this great utility called TCPView from ms
https://technet.microsoft.com/en-us/library/bb897437.aspx