Example #1
0
        public void Connect(UInt32 conv, string host, UInt16 port)
        {
            var addr = IPAddress.Parse(host);

            remoteEnd = new IPEndPoint(addr, port);
            socket    = new Socket(addr.AddressFamily, SocketType.Dgram, ProtocolType.Udp);
            socket.Connect(remoteEnd);

            kcp = new KCP(conv, this);
            kcp.SetOutput(OutputKCP);

            // fast mode
            kcp.NoDelay(1, 10, 2, 1);
            kcp.WndSize(128, 128);
        }