提交 7d286b4a 编写于 作者: Y youngwolf

Close connected UDP for normal UDP (to support receiving messages from multipile peers).

上级 a6d7bfb3
......@@ -11,7 +11,7 @@
//you will see them cross together on the receiver's screen.
//with this macro, if heartbeat not applied, macro ST_ASIO_AVOID_AUTO_STOP_SERVICE must be defined to avoid the service_pump run out.
#define ST_ASIO_AVOID_AUTO_STOP_SERVICE
#define ST_ASIO_UDP_CONNECT_MODE true
//#define ST_ASIO_UDP_CONNECT_MODE true
//#define ST_ASIO_HEARTBEAT_INTERVAL 5 //neither udp_unpacker nor udp_unpacker2 support heartbeat message, so heartbeat will be treated as normal message.
//#define ST_ASIO_DEFAULT_UDP_UNPACKER udp_unpacker2<>
//configuration
......@@ -65,6 +65,8 @@ int main(int argc, const char* argv[])
if (0 == index)
{
service.set_connect_mode();
//reliable_socket cannot become reliable without below statement, instead, it downgrade to normal UDP socket
service.create_kcpcb(0, (void*) &service);
//without below statement, your application will core dump
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册