示例#1
0
        public static void start()
        {
            KcpRttExampleServer kcpRttExampleServer = new KcpRttExampleServer();

            ChannelConfig channelConfig = new ChannelConfig();

            channelConfig.initNodelay(true, 40, 2, true);
            channelConfig.Sndwnd              = 512;
            channelConfig.Rcvwnd              = 512;
            channelConfig.Mtu                 = 512;
            channelConfig.FecDataShardCount   = 3;
            channelConfig.FecParityShardCount = 1;
            channelConfig.AckNoDelay          = true;
            channelConfig.TimeoutMillis       = 10000;
            channelConfig.UseConvChannel      = true;
            KcpServer kcpServer = new KcpServer();

            kcpServer.init(Environment.ProcessorCount, kcpRttExampleServer, channelConfig, 20003);
        }
示例#2
0
 public bool Init(ChannelConfig channelConfig, IPEndPoint ep)
 {
     server = new KcpServer();
     server.init(Environment.ProcessorCount, this, channelConfig, ep.Port);
     return(true);
 }