Windows.Networking.Sockets.DatagramSocket.JoinMulticastGroup C# (CSharp) Method

JoinMulticastGroup() public method

public JoinMulticastGroup ( [ host ) : void
host [
return void
		public extern void JoinMulticastGroup([In] HostName host);
		[Overload("GetOutputStreamAsync")]

Usage Example

Esempio n. 1
0
        private async void Init()
        {
            _Listener = new DatagramSocket();
            _Listener.MessageReceived += Listener_MessageReceived;

            while (true)
            {
                try
                {
                    await _Listener.BindServiceNameAsync("6");
                    break;
                }
                catch (COMException)
                {
                    var messageDialog = new MessageDialog("Only one usage of each port is normally permitted.\r\n\r\nIs 'Windows IoT Core Watcher' open?", "Port in use");
                    messageDialog.Commands.Add(new UICommand("Try again", (command) => { }));
                    await messageDialog.ShowAsync();
                }
            }

            HostName hostname = new HostName("239.0.0.222");
            _Listener.JoinMulticastGroup(hostname);

            _Settings = ApplicationData.Current.LocalSettings;

            _Timer = new Timer(Timer_Callback, null, 1000, 1000);
        }
All Usage Examples Of Windows.Networking.Sockets.DatagramSocket::JoinMulticastGroup