コード例 #1
0
    // Use this for initialization
    void Start()
    {
        client = new MyKcp();
        client.NoDelay(1, 10, 2, 1);    //fast
        client.WndSize(64, 64);
        client.Timeout(10 * 1000);
        client.SetMtu(512);
        client.SetMinRto(10);
        client.SetConv(121106);
        //client.Connect("119.29.153.92", 2222);
        client.Connect("127.0.0.1", 10086);
        client.Start();

        StartCoroutine(Co());
    }
コード例 #2
0
    public void Connect(string host, int port)
    {
        if (null != client)
        {
            client.Stop();
        }

        client = new MyKcp();
        client.NoDelay(1, 10, 2, 1);//fast
        client.WndSize(4096, 4096);
        client.Timeout(40 * 1000);
        client.SetMtu(512);
        client.SetMinRto(10);
        client.SetConv(121106);

        client.Connect(host, port);

        client.Start();
    }