Beispiel #1
0
        private void InitKcp()
        {
            switch (this.Service.ServiceType)
            {
            case ServiceType.Inner:
                Kcp.KcpNodelay(kcp, 1, 10, 2, 1);
                Kcp.KcpWndsize(kcp, 1024 * 100, 1024 * 100);
                Kcp.KcpSetmtu(kcp, 1400);                         // 默认1400
                Kcp.KcpSetminrto(kcp, 10);
                break;

            case ServiceType.Outer:
                Kcp.KcpNodelay(kcp, 1, 10, 2, 1);
                Kcp.KcpWndsize(kcp, 128, 128);
                Kcp.KcpSetmtu(kcp, 470);
                Kcp.KcpSetminrto(kcp, 10);
                break;
            }
        }
Beispiel #2
0
        private void InitKcp()
        {
            KcpPtrChannels.Add(this.kcp, this);
            switch (this.Service.ServiceType)
            {
            case ServiceType.Inner:
                Kcp.KcpNodelay(kcp, 1, 10, 2, 1);
                Kcp.KcpWndsize(kcp, ushort.MaxValue, ushort.MaxValue);
                Kcp.KcpSetmtu(kcp, 1400);                         // 默认1400
                Kcp.KcpSetminrto(kcp, 30);
                break;

            case ServiceType.Outer:
                Kcp.KcpNodelay(kcp, 1, 10, 2, 1);
                Kcp.KcpWndsize(kcp, 256, 256);
                Kcp.KcpSetmtu(kcp, 470);
                Kcp.KcpSetminrto(kcp, 30);
                break;
            }
        }