using Plane.Communication; using Plane.Messaging; using System.Net; using System.Threading; namespace Plane.CopterManagement { public class SingleDtuCopterManager : SingleCopterManager { public SingleDtuCopterManager(IPLMessenger messenger, SynchronizationContext uiSyncContext) : base(messenger, uiSyncContext) { } /// /// 对于作为连接客户端,不存在任何搜索的逻辑,一切由服务端决定。 /// public override void StartSearching() { // var ip = "139.217.128.128"; // var port = 5250; // var copterID = "40002"; //#if !NETFX_CORE // var ipEnd = new IPEndPoint(IPAddress.Parse(ip), port); // var udpConnection = new UdpThroughDtuServiceConnection(ipEnd) { CopterIDToBind = copterID }; //#else // var udpConnection = new UdpThroughDtuServiceConnection(ip, port) { CopterIDToBind = copterID }; //#endif // await AddOrUpdateCopterAsync(ip, ip.Substring(ip.LastIndexOfAny(new[] { '.', ':' }) + 1), udpConnection); } } }