Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Feb 1, 2024
1 parent d79fa4f commit b5f42f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/speed/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Test detail, please see: https://github.com/yasio/yasio/blob/master/benchmark.md
#endif

// speedtest kcp mtu to max mss of udp (65535 - 20(ip_hdr) - 8(udp_hdr))
// wsl2 mirrored network only allow udp mss to 1500 - 28 = 1472
#define SPEEDTEST_UDP_MSS 65507
#define SPEEDTEST_KCP_MTU SPEEDTEST_UDP_MSS
#define SPEEDTEST_KCP_MSS (SPEEDTEST_KCP_MTU - 24)
Expand All @@ -64,7 +65,7 @@ namespace speedtest
{
enum
{
RECEIVER_PORT = 3002,
RECEIVER_PORT = 30001,
SENDER_PORT = RECEIVER_PORT,
#if !SPEEDTEST_VIA_UDS
RECEIVER_CHANNEL_KIND = SPEEDTEST_SERVER_KIND | SPEEDTEST_SSL_MASK,
Expand Down Expand Up @@ -187,6 +188,7 @@ void start_sender(io_service& service)
obs.write_bytes(buffer, PER_PACKET_SIZE);

service.set_option(YOPT_S_HRES_TIMER, 1);
service.set_option(YOPT_S_FORWARD_PACKET, 1);

#if YASIO_SSL_BACKEND != 0
service.set_option(YOPT_S_SSL_CACERT, SSLTEST_CACERT);
Expand Down Expand Up @@ -238,6 +240,10 @@ void start_sender(io_service& service)
service.set_option(YOPT_C_KCP_CONV, 0, s_kcp_conv);
#endif

#if SPEEDTEST_TRANSFER_PROTOCOL != SPEEDTEST_PROTO_TCP
service.set_option(YOPT_C_LOCAL_HOST, 0, SPEEDTEST_SOCKET_NAME);
#endif

service.open(0, speedtest::SENDER_CHANNEL_KIND);
}

Expand Down

0 comments on commit b5f42f1

Please sign in to comment.