https://github.com/stubma/cocos2dx-better
- Port into cocos2dx v3
- Remove some dependencies (this part can work individually)
- thread safe
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();
get server in /server/socketserver.py and run it in your local host to test connection.
``` shell
python socketserver.py
```
- JSONUtils: https://github.com/kudo108/CCJsonUtils
If you have any question, feel free to ask me, I will help you!
- Skype: kudo_108
- Email: quan.nguyenvan000@gmail.com