Example #1
0
 // accept
 public KChannel(uint nConn, uint nRemoteConn, UdpClient rSocket, IPEndPoint rRemoteEndPoint, KService rKService) : base(rKService, ChannelType.Accept)
 {
     this.Id              = nConn;
     this.Conn            = nConn;
     this.RemoteConn      = nRemoteConn;
     this.mRemoteEndPoint = rRemoteEndPoint;
     this.mSocket         = rSocket;
     this.mParser         = new PacketParser(this.mRecvBuffer);
     this.mKcp            = new Kcp(this.RemoteConn, this.Output);
     this.mKcp.SetMtu(512);
     this.mKcp.NoDelay(1, 10, 2, 1);              //fast
     this.mIsConnected  = true;
     this.mLastRecvTime = rKService.mTimeNow;
 }