示例#1
0
    /// <summary>
    /// Connect to the specified destination.
    /// </summary>

    static public void Connect(string address, int port)
    {
        IPEndPoint ip = Tools.ResolveEndPoint(address, port);

        if (ip == null)
        {
            if (mInstance != null)
            {
                mInstance.OnConnect(false, "Unable to resolve " + address);
            }
        }
        else if (mInstance != null)
        {
            mInstance.mClient.playerName = mPlayer.name;
            mInstance.mClient.Connect(ip, null);
        }
    }