예제 #1
0
파일: KChannel.cs 프로젝트: Bestpoker/ET
        // accept
        public KChannel(uint conn, uint remoteConn, Socket socket, IPEndPoint remoteEndPoint, KService kService) : base(kService, ChannelType.Accept)
        {
            this.Id             = conn;
            this.Conn           = conn;
            this.RemoteConn     = remoteConn;
            this.remoteEndPoint = remoteEndPoint;
            this.socket         = socket;
            kcp = new KCP(this.RemoteConn, this);
            kcp.SetOutput(this.Output);
            kcp.NoDelay(1, 10, 2, 1);              //fast
            this.isConnected = true;

            this.lastRecvTime = kService.TimeNow;
        }
예제 #2
0
        public void HandleConnnect(uint responseConn)
        {
            if (this.isConnected)
            {
                return;
            }
            this.isConnected = true;
            this.RemoteConn  = responseConn;
            this.kcp         = new KCP(responseConn, this);
            kcp.SetOutput(this.Output);
            kcp.NoDelay(1, 10, 2, 1);              //fast

            HandleSend();
        }
예제 #3
0
파일: KChannel.cs 프로젝트: Bestpoker/ET
        public void HandleConnnect(uint responseConn)
        {
            if (this.isConnected)
            {
                return;
            }
            this.isConnected = true;
            this.RemoteConn  = responseConn;
            this.kcp         = new KCP(responseConn, this);
            kcp.SetOutput(this.Output);
            kcp.NoDelay(1, 10, 2, 1);              //fast

            this.lastRecvTime = this.GetService().TimeNow;

            HandleSend();
        }
예제 #4
0
        // accept
        public KChannel(uint conn, uint remoteConn, Socket socket, IPEndPoint remoteEndPoint, KService kService) : base(kService, ChannelType.Accept)
        {
            this.InstanceId = IdGenerater.GenerateId();

            this.Id             = conn;
            this.Conn           = conn;
            this.RemoteConn     = remoteConn;
            this.remoteEndPoint = remoteEndPoint;
            this.socket         = socket;
            kcp = new KCP(this.RemoteConn, this);
            kcp.SetOutput(this.Output);
            kcp.NoDelay(1, 10, 2, 1);              //fast
            kcp.SetMTU(470);
            kcp.WndSize(256, 256);
            this.isConnected = true;

            this.lastRecvTime = kService.TimeNow;
        }