A mini cross platform posix socket API wrapper(support IPv6-only network, Integrated with Application Layer Binary Protocol Auto Generator)

A mini cross platform posix socket API wrapper(support IPv6-only network, Integrated with Application Layer Binary Protocol Auto Generator)
0.0 0

#1

This is a mini cross platform posix socket API wrapper, support win32 &
linux & ios & android & wp8 & wp8.1-universal &
win10-universal
It also support IPv6-only network.

usage:

#include "xxsocket.h"
using namespace purelib::net;
// server
xxsocket tcpserv;
if(0 == tcpserv.pserv("192.168.1.23"/*could be ipv6 address*/, 2016)) {
    xxsocket cli = tcpserv.accept();
    char buffer[256];
    cli.recv(buffer, sizeof("hello server"));
}

// client
xxsocket tcpcli;
if(0 == tcpserv.xpconnect("192.168.1.23"/*could be ipv6 address or hostname*/, 2016)) {
    tcpcli.send(buffer, sizeof("hello server"));
}

#2

Please don’t just post a blind link. Introduce it and put it in Game/Demo Showcase

Edit, actually put it in Extensions


#3

OK, I done it.


#4

Add Application Layer Binary Protocol C++ enc/dec source code & luabinding Auto Generator


#5

Add API xxsocket::xpconnect/xxsocket::xpconnect_n for ipv6 only support.


#6

Add async tcp client & timer support.


#7

2.3.5
optimize tcp recv read performance when busy.


#8

@halx99

Is this lib is not depending on any Third party libs like boost . for A sync and UDP
you absolutely got here something that is missing from the c++ world and cocos2d-x .
Well done


#9

another one https://github.com/cloudwu/lsocket


#10

Yes, It’s not depending any 3rd party libs.
And fix compare operator error bug.


#11

V3.0 released:

  1. Support multi-channels at one thread service.
  2. Async reconnect support
  3. Optimize log for cross platform
  4. Optimize log for cocos2d, avoid crash
  5. Optimize unpack logic
  6. Avoid buffer attack
  7. Integrate c-ares support, macro: _USE_ARES_LIB, default value is 0

#12

update v3.0-rel
1.Support multi-channels at 1 thread service.
2.Async reconnect support
3.Optimize log for cross platform
4.Optimize log for cocos2d, avoid crash
5.Optimize unpack logic
6.Avoid buffer attack
7.Integrate c-ares support, macro: _USE_ARES_LIB, default value is 0
8.Add macros to control whether use object pool, shared_ptr and enable send callback
9.Fix shutdown can’t close connection.
10.object_pool, thread safe support