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

Wrong default port of SocketIO connection #17416

Closed
dumganhar opened this issue Feb 27, 2017 · 2 comments
Closed

Wrong default port of SocketIO connection #17416

dumganhar opened this issue Feb 27, 2017 · 2 comments
Assignees
Milestone

Comments

@dumganhar
Copy link

  • cocos2d-x version: 3.14.1
  • devices test on: ALL platforms
  • developing environments
    • NDK version: r10e
    • Xcode version: 8.2.1
    • VS version: 2013, 2015
    • browser type and version: N/A
SIOClient* SocketIO::connect(const std::string& uri, SocketIO::SIODelegate& delegate)
{
    std::string host = uri;
    int port = 0;  // James: Why it's initialized with 0?
    size_t pos = 0;

    pos = host.find("//");
    if (pos != std::string::npos)
    {
        host.erase(0, pos+2);
    }

    pos = host.find(":");
    if (pos != std::string::npos)
    {
        port = atoi(host.substr(pos+1, host.size()).c_str());
    }
@dumganhar dumganhar added this to the 3.15 milestone Feb 27, 2017
@dumganhar dumganhar self-assigned this Feb 27, 2017
@dumganhar
Copy link
Author

Uses Uri class to parse URL will resolve this issue.
Depend on #17455 to be merged.

dumganhar pushed a commit to dumganhar/cocos2d-x that referenced this issue Mar 7, 2017
Supports SSL connection for SocketIO.
Avoid memory corruption while disconnecting SocketIO, _ws->close() has to be at the end of ‘SIOClientImpl::disconnect()’.
@dumganhar
Copy link
Author

fixed at #17459

@minggo minggo closed this as completed in 1c0e56e Mar 7, 2017
stevetranby added a commit to stevetranby/cocos2d-x that referenced this issue Mar 9, 2017
…futurePRs

* commit '5c0c6d2e1e4b1772efc239d23f8cdaf8ce79a898':
  More powerful Uri class, adds unit test for Uri class. Refactors some code in SocketIO & Websocket. (cocos2d#17472)
  Prevent signed/unsigned mismatch (cocos2d#17468)
  fix the issue that onEnterTransitionDidFinish() is not invoked at first scene change (cocos2d#17466)
  csbload error bug (cocos2d#17465)
  *Fix: GLThread and other threads access sDownloaderMap in a thread-unsafe way, which will result in crash in some occasion on Android. (cocos2d#16326)
  fixed cocos2d#17416: Wrong default port of SocketIO connection. (cocos2d#17459)
  [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#17458)
  fixed cocos2d#17427: lws_parse_url has wrong behavior, it parses ’ws://domain.com/abc/d’ to ‘path: abc/d’ rather than ‘path: /adb/d’. (cocos2d#17455)
  [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#17456)
  Prevent unexpected calls to unscheduled selector in long updates. (cocos2d#17431)
  fix the broken of lua-tests after PR cocos2d#17445 was merged. (cocos2d#17454)
  [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#17453)
  Solve the error logic in spine runtime. (cocos2d#17448)
  cocos2d::Sequence::isDone() checks that the last action is actually done. (cocos2d#17437)
  Websocket bug fix after PR#17440 was merged. (cocos2d#17450)
  [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#17449)
  Some fixes for search paths: (cocos2d#17435)
  update external version (cocos2d#17446)
  fixed cocos2d#17433: [webSocket ] webSocket random crash in win32 (cocos2d#17440)
  Fix some local variable names in tests (cocos2d#17445)

# Conflicts:
#	web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant