Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 #15666

Merged
merged 4 commits into from May 18, 2016

Conversation

Projects
None yet
9 participants
@minggo
Copy link
Contributor

commented May 18, 2016

No description provided.

@minggo minggo merged commit 2232656 into cocos2d:v2 May 18, 2016

@minggo minggo referenced this pull request May 18, 2016

Closed

Supporting IPv6-only Networks #15629

8 of 8 tasks complete
@11lin

This comment has been minimized.

Copy link

commented May 27, 2016

good

@shishiswe

This comment has been minimized.

Copy link

commented Jun 7, 2016

您好,我使用的是cocos2dx—3.x版本,C++语言,编辑环境是苹果的Xcode,在升级之后运行进程中WebSocket.cpp文件抛出大量错误,请问如何解决?我使用3.x按照2.x修改了WebSocket.cpp文件还是有很多错误。麻烦您能百忙之中写一下3.x版本怎么修改WebSocket.cpp与WebSocket.h文件吗?谢谢了,确实有点着急,打搅了。

@openwave1

This comment has been minimized.

Copy link

commented Jun 8, 2016

@minggo 您好麻烦问下,我这边cocos2dx-2.x版本,接完最新修改后,使用域名解析是可以链接的,但是使用ipv4的固定ip链接失败,这个可能是哪里问题,谢谢

@openwave1

This comment has been minimized.

Copy link

commented Jun 8, 2016

@shishiswe
43dd696
这是websocket文件

@jianhuang0

This comment has been minimized.

Copy link

commented Jun 13, 2016

quick 3.3的版本,替换了 webSocket 和 curl 的库之后 43dd696 再替换了websocket的代码,xcode 编译报错 "libwebsockets.h not found" @minggo 请问要怎么解决?

@shishiswe 请问你的问题解决了吗?

@minggo

This comment has been minimized.

Copy link
Contributor Author

commented Jun 13, 2016

Hi guys, please use english in future, then other developers can help you too. If you are not confident with English, you can google translate to translate it. You can paste english together with Chinese. Thanks.

@redcloser libwebsockets.h's location keeps the same as previous version. Could you please check if it exists in external/libwebsockets/ios/includes. If it exists, then just add it to search path. If it is not exists, then i think you don't replace the libs correctly.

@openwave1

This comment has been minimized.

Copy link

commented Jun 13, 2016

@minggo I has Used the new curl. In ipv6 network, it can connect the domain name, but can not connect a fixed ip (such as *. *. *. *), is it something wrong with me?

@minggo

This comment has been minimized.

Copy link
Contributor Author

commented Jun 13, 2016

@openwave1 Yep, you should use domain name. Fix ip address is IPv6/v4 specific.

@openwave1

This comment has been minimized.

Copy link

commented Jun 13, 2016

@minggo Thank you!

@jianhuang0

This comment has been minimized.

Copy link

commented Jun 13, 2016

thanks, file libwebsockets.h exists in external/websockets/include/ and i have added this path into the xcode Hearder Search Path like this $(SRCROOT)/../../cocos2d-x/external/websockets/include/ios.
but xcode still compile error libwebsockets.h not found @minggo

@yuanyouli

This comment has been minimized.

Copy link

commented Jun 14, 2016

when connect to tomcat 8.0.33

ERR: lws_client_interpret_server_handshake: unable to parse remote defaults 'client_max_window_bits=15'
WebSocket (0x12d764790) onConnectionError ...
Ready state is closing or was closed, code=2, quit websocket thread!
NOTICE: lws_context_destroy

@minggo

This comment has been minimized.

Copy link
Contributor Author

commented Jun 15, 2016

@redcloser I have not idea, please make sure $(SRCROOT)/../../cocos2d-x/external/websockets/include/ios is correct.

@yuanyouli
ERR: lws_client_interpret_server_handshake: unable to parse remote defaults 'client_max_window_bits=15'
The error log tell you the problem. But i don't know why it has the problem, i think you should ask it in libwebsocket repo.

@Zinitter

This comment has been minimized.

Copy link

commented Jun 16, 2016

@shishiswe @redcloser

I have success compiled the Cocos2d-JS library v3.8.1 but not sure it's working as i can't setup the NAT64 network provided by Apple.

If you follow v2 modification on v3, you need to change enum lws_callback_reasons to int reason

You don't need to add this
#include "external/websockets/include/ios/libwebsockets.h" in WebSocket.h

WebSocket.h
Change this
int onSocketCallback(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len);

to this
int onSocketCallback(struct lws *wsi, int reason, void *user, void *in, ssize_t len);

WebSocket.cpp
Change this
int WebSocket::onSocketCallback(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len)

to this
int WebSocket::onSocketCallback(struct lws *wsi, int reason, void *user, void *in, ssize_t len)

Please check if it works.
Thank you.

@chenzhongqiang

This comment has been minimized.

Copy link

commented Jun 23, 2016

现在情况是,按照cocos2dx 的集成说明集成了最新ipv6的相关库和代码,ipv6环境搭建成功

返回: CURLE_COULDNT_CONNECT(7) connect()的主机或代理失败。

IPV4网络环境正常下载

IPV6网络环境返回 CURLE_COULDNT_CONNECT(7) , 但使用浏览器是能打印这个链接地址的。

@chenzhongqiang

This comment has been minimized.

Copy link

commented Jun 23, 2016

I have success compiled the quickv3.3 library, i meet error CURLE_COULDNT_CONNECT(7) or CURLE_COULDNT_RESOLVE_HOST(6)

@minggo

This comment has been minimized.

Copy link
Contributor Author

commented Jun 23, 2016

This PR is for v2, please create an github issue about it. And you can not use IP address, use domain instead.

@chenzhongqiang

This comment has been minimized.

Copy link

commented Jun 23, 2016

I used domain

@chenzhongqiang

This comment has been minimized.

Copy link

commented Jun 23, 2016

i visit http://www.baidu.com failed by error CURLE_COULDNT_RESOLVE_HOST(6)

@chenzhongqiang

This comment has been minimized.

Copy link

commented Jun 23, 2016

i open curl debug info

Rebuilt URL to: http://www.baidu.com/

  • Trying 180.97.33.108...
  • Immediate connect fail for 180.97.33.108: Network is unreachable
  • Trying 180.97.33.107...
  • Immediate connect fail for 180.97.33.107: Network is unreachable
  • Closing connection 0
    request onrequest S_ID:2 errorcode 7
@hemanthunity

This comment has been minimized.

Copy link

commented Jul 19, 2016

Hi,
I followed your steps to upgrade my old project which was developed on 2.x, After adding libcrypto.a,libcurl.a,libwebsocket.a it worked like charm. Thanks for the Post

@minggo minggo added this to the v2 milestone Jul 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.