【发布时间】:2017-11-17 12:27:48
【问题描述】:
我的 Mac (192.168.100.61:9080 ip) 上有一个正在运行的 Realm 对象服务器,PC 上有 Xamarin 应用程序。 我想在 ROS 上保存/同步数据。 如何从代码连接到 ROS?
【问题讨论】:
-
这可能有助于在此站点上获得更好的响应:stackoverflow.com/help/how-to-ask
我的 Mac (192.168.100.61:9080 ip) 上有一个正在运行的 Realm 对象服务器,PC 上有 Xamarin 应用程序。 我想在 ROS 上保存/同步数据。 如何从代码连接到 ROS?
【问题讨论】:
您需要登录/注册一个用户并打开一个同步的领域。比如:
// pass createUser: true to register rather than login
var credentials = Credentials.UsernamePassword("foo@bar.com", "super-secure", createUser: false);
// Login the user
var user = await User.LoginAsync(credentials, new Uri("http://192.168.100.61:9080"));
// Create a sync configuration for the Realm
// Notice the URL uses the realm scheme and not http
var config = new SyncConfiguration(user, new Uri("realm://192.168.100.61:9080/~/myrealm"));
// Finally, get the Realm instance
// This Realm will be kept in sync with the remote one
var realm = Realm.GetInstance(config);
更多详情,请查看documentation。
【讨论】: