Ejemplo n.º 1
0
        /// <summary>
        /// Used to send SSDP packet
        /// </summary>
        /// <param name="data">The SSDP packet</param>
        /// <returns>unused</returns>
        public async Task<int> Send(string data)
        {

            var socket = new global::Windows.Networking.Sockets.DatagramSocket();
            {
                var profile = NetworkInformation.GetInternetConnectionProfile();

                
                socket.MessageReceived += (sender, args) =>
                {
                    var reader = new StreamReader(args.GetDataStream().AsStreamForRead());
                    {
                        string response = reader.ReadToEndAsync().Result;
                        OnMessageReceived(new MessageReceivedArgs(response));
                    }
                };

                socket.BindServiceNameAsync("", profile.NetworkAdapter);

                var remoteHost = new global::Windows.Networking.HostName(SSDP.Address);
                var reqBuff = Encoding.UTF8.GetBytes(data);

                var stream = await socket.GetOutputStreamAsync(remoteHost, SSDP.Port.ToString());
                await stream.WriteAsync(reqBuff.AsBuffer());

                if (socketJoined) return 0;

                socket.JoinMulticastGroup(remoteHost);
                socketJoined = !socketJoined;

                return 0;
            }
        }
Ejemplo n.º 2
0
 public static global::Windows.Foundation.IAsyncOperation <global::Windows.System.RemoteSystems.RemoteSystem> FindByHostNameAsync(global::Windows.Networking.HostName hostName)
 {
     throw new global::System.NotImplementedException("The member IAsyncOperation<RemoteSystem> RemoteSystem.FindByHostNameAsync(HostName hostName) is not implemented in Uno.");
 }
Ejemplo n.º 3
0
 public bool IsEqual(global::Windows.Networking.HostName hostName)
 {
     throw new global::System.NotImplementedException("The member bool HostName.IsEqual(HostName hostName) is not implemented in Uno.");
 }
Ejemplo n.º 4
0
 public global::Windows.Foundation.IAsyncOperation <global::Windows.Storage.Streams.IOutputStream> GetOutputStreamAsync(global::Windows.Networking.HostName remoteHostName, string remoteServiceName)
 {
     throw new global::System.NotImplementedException("The member IAsyncOperation<IOutputStream> DatagramSocket.GetOutputStreamAsync(HostName remoteHostName, string remoteServiceName) is not implemented in Uno.");
 }
Ejemplo n.º 5
0
 public void JoinMulticastGroup(global::Windows.Networking.HostName host)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.Networking.Sockets.DatagramSocket", "void DatagramSocket.JoinMulticastGroup(HostName host)");
 }
Ejemplo n.º 6
0
 public global::Windows.Foundation.IAsyncAction BindEndpointAsync(global::Windows.Networking.HostName localHostName, string localServiceName)
 {
     throw new global::System.NotImplementedException("The member IAsyncAction DatagramSocket.BindEndpointAsync(HostName localHostName, string localServiceName) is not implemented in Uno.");
 }
Ejemplo n.º 7
0
 public global::Windows.Foundation.IAsyncAction ConnectAsync(global::Windows.Networking.HostName remoteHostName, string remoteServiceName)
 {
     throw new global::System.NotImplementedException("The member IAsyncAction DatagramSocket.ConnectAsync(HostName remoteHostName, string remoteServiceName) is not implemented in Uno.");
 }
Ejemplo n.º 8
0
 public static global::Windows.Foundation.IAsyncOperation <global::System.Collections.Generic.IReadOnlyList <global::Windows.Networking.EndpointPair> > GetEndpointPairsAsync(global::Windows.Networking.HostName remoteHostName, string remoteServiceName, global::Windows.Networking.HostNameSortOptions sortOptions)
 {
     throw new global::System.NotImplementedException("The member IAsyncOperation<IReadOnlyList<EndpointPair>> DatagramSocket.GetEndpointPairsAsync(HostName remoteHostName, string remoteServiceName, HostNameSortOptions sortOptions) is not implemented in Uno.");
 }
Ejemplo n.º 9
0
 public DnssdServiceInstance(string dnssdServiceInstanceName, global::Windows.Networking.HostName hostName, ushort port)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.Networking.ServiceDiscovery.Dnssd.DnssdServiceInstance", "DnssdServiceInstance.DnssdServiceInstance(string dnssdServiceInstanceName, HostName hostName, ushort port)");
 }
Ejemplo n.º 10
0
 public EndpointPair(global::Windows.Networking.HostName localHostName, string localServiceName, global::Windows.Networking.HostName remoteHostName, string remoteServiceName)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.Networking.EndpointPair", "EndpointPair.EndpointPair(HostName localHostName, string localServiceName, HostName remoteHostName, string remoteServiceName)");
 }
Ejemplo n.º 11
0
 public RoutePolicy(global::Windows.Networking.Connectivity.ConnectionProfile connectionProfile, global::Windows.Networking.HostName hostName, global::Windows.Networking.DomainNameType type)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.Networking.Connectivity.RoutePolicy", "RoutePolicy.RoutePolicy(ConnectionProfile connectionProfile, HostName hostName, DomainNameType type)");
 }
Ejemplo n.º 12
0
 public void AddAllowedHostRange(global::Windows.Networking.HostName first, global::Windows.Networking.HostName last)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.Networking.NetworkOperators.MobileBroadbandModemIsolation", "void MobileBroadbandModemIsolation.AddAllowedHostRange(HostName first, HostName last)");
 }
Ejemplo n.º 13
0
 public VpnRoute(global::Windows.Networking.HostName address, byte prefixSize)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.Networking.Vpn.VpnRoute", "VpnRoute.VpnRoute(HostName address, byte prefixSize)");
 }
Ejemplo n.º 14
0
 public global::Windows.Foundation.IAsyncAction UpgradeToSslAsync(global::Windows.Networking.Sockets.SocketProtectionLevel protectionLevel, global::Windows.Networking.HostName validationHostName)
 {
     throw new global::System.NotImplementedException("The member IAsyncAction StreamSocket.UpgradeToSslAsync(SocketProtectionLevel protectionLevel, HostName validationHostName) is not implemented in Uno.");
 }
Ejemplo n.º 15
0
 public global::Windows.Foundation.IAsyncAction ConnectAsync(global::Windows.Networking.HostName remoteHostName, string remoteServiceName, global::Windows.Networking.Sockets.SocketProtectionLevel protectionLevel, global::Windows.Networking.Connectivity.NetworkAdapter adapter)
 {
     throw new global::System.NotImplementedException("The member IAsyncAction StreamSocket.ConnectAsync(HostName remoteHostName, string remoteServiceName, SocketProtectionLevel protectionLevel, NetworkAdapter adapter) is not implemented in Uno.");
 }
Ejemplo n.º 16
0
 public static global::Windows.Foundation.IAsyncOperation <global::Windows.Devices.Bluetooth.BluetoothDevice> FromHostNameAsync(global::Windows.Networking.HostName hostName)
 {
     throw new global::System.NotImplementedException("The member IAsyncOperation<BluetoothDevice> BluetoothDevice.FromHostNameAsync(HostName hostName) is not implemented in Uno.");
 }