Skip to content

quannv108/TCPSocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TCPSocket

Original project:
https://github.com/stubma/cocos2dx-better
Updates:
- Port into cocos2dx v3 - Remove some dependencies (this part can work individually) - thread safe
Example:
   std::string s = "simple_string";
    
    auto mainHub = funny::network::TCPSocketHub::create();
    mainHub->setRawPolicy(true);
    mainHub->retain();
    
    auto socket = mainHub->createSocket("your ip here", 6869, 11);
    
    auto packet = new funny::network::Packet();
    packet->initWithRawBuf(s.c_str(), s.length(), -1);
    
    socket->sendPacket(packet);
    
    packet->release();
Test server
get server in /server/socketserver.py and run it in your local host to test connection. ``` shell python socketserver.py ```
Dependencies
- JSONUtils: https://github.com/kudo108/CCJsonUtils
Contacts:
If you have any question, feel free to ask me, I will help you! - Skype: kudo_108 - Email: [email protected]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published