The yasio-3.33.x is released!

Project Home page:

Wht’s yasio?

  • A cross-platform non-blocking socket library focus on any client application network development.
  • Support OS: win,linux,android,ios,osx and etc.
  • Support game engines: cocos2d-x, unity3d, ue4 and etc.
  • Same API to manipulate transport with TCP, UDP, KCP.

yaiso-3.33.2 (2020.6.23)

  • Fix c-ares doesn’t get system dns for ios.
  • Add option YOPT_S_DNS_DIRTY for user to change system name servers after mobile network changed when c-ares enabled.
  • Refine write event register when system kernel write buffer is full.

yaiso-3.33.1 (2020.6.8)

  • Reduce the size of the Windows header files.
  • Improve yasio::inet::ip::endpoint code style.
  • Explicit socket_select_interrupter workaround code logic for borken firewalls on Windows.
  • Sets and pass user data of transport through event.
  • Fix KCP do_read may can’t dispatch upper data to user.
  • Fix behavior of yasio::wcsfmt.

yasio-3.33.0 (2020.5.26)

  • Refactor UDP like transport, UDP client don’t establish 4-tuple with peer, and provide YPOT_T_CONNECT and YPOT_T_DISCONNECT to change association.
  • Add io_service::write_to for unconnected/connected UDP transport.
  • Remove unused channel masks YCM_MCAST_CLIENT, YCM_MCAST_SERVER
  • Remove unused channel flag YCF_MCAST_LOOPBACK
  • Add new options YOPT_C_ENABLE_MCAST, YOPT_C_DISABLE_MCAST for multicast support
  • Change timer_cb_t prototype to []()->bool { }, return true for once, false for continue.
  • Add highp_timer::async_wait_once to wait timer timeout once.
  • Add yasio::xhighp_clock to retrive nanoseconds timestamp.
  • Fix xxsocket APIs connect_n, recv_n doesn’t handle signal EINTR.
  • Tidy obstream/ibstream API, by default write_v/read_v use 7bit encoded int for length field.
  • Rename io_service start_service/stop_service to start/stop.
  • Fix c-ares timeout behavior.
  • Improve c-ares cleanup behavior, now destruct io_service more stable with c-ares enabled.
  • Make cxx17::string_view support unordered set/map on compilers which only support c++11 standard.
  • Use shared_ptr + shared_mutex to ensure destruct io_service safe without side affect for concurrency of name resolving.
  • Fix dns cache timeout mechanism doesn’t work.
  • Simplify c-ares dns-server setup on android, when use yasio as static library, you need call yasio__jni_onload at JNI_OnLoad.
  • Fix yasio::_strfmt may crash on some incorrect use, now it’s more stable on all platforms.
  • Improve behavior when kernel send buffer is full, don’t sleep a fixed time, just drived by select.
  • Optimize udp transport close behavior, by default, udp transport will never close except user request, still can use io_service’s option YOPT_S_IGNORE_UDP_ERROR to change this behavior.
  • Change write completion handler prototype to: std::function<void(int ec, size_t bytes_transferred)>.
  • Implement literals for cxx17::string_view.
  • Fix ssl handshake failed with certificate verify failed when cacert file provided and flag SSL_VERIFY_PEER was set.
  • Fix doesn’t call io_service destructor when use lua binding library kaguya on compiler without c++14 support.
  • Add io_service::init_globals(const print_fn_t&) to support redirect initialization log to custom file(U3D/UE4 Console).
  • Improve compiler support, now support c++14, c++17, c++20.
  • Auto choose library sol2 for lua binding when cxx_std >= 14, older require cxx_std >= 17.
  • Recreate the socket_select_interrupter’s sockets on error.
  • Update kcp to v1.7, the kcp older version may cause SIGBUS on mobile ARM.
  • Simplify API, remove unnecessary API io_service::reopen, please use io_service::open instead.
  • Fix crash at yasio::inet::ip::endpoint::ip() when af=0.
  • Make io_service::write to a kcp return value same as other channel.
  • Fix kcp server doesn’t decode packet header.
  • Add xxsocket::disconnect to dissolve the 4-tuple association.
  • Rename option YOPT_I_SOCKOPT to YOPT_B_SOCKOPT.
  • Other code quality & stable improvements.

Hi there,

It is really interesting. Could we have an example project for cocos creator with UDP socket?

Hello, there is a example project with tcp,udp,kcp test:
and the simuator with yasio can be download at:

yaiso-3.33.4 released

  • Add log level support, use option YOPT_S_PRINT_FN2