Ejemplo n.º 1
0
        // 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;
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
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

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

            HandleSend();
        }
Ejemplo n.º 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;
        }