Windows.Networking.Sockets.DatagramSocket.JoinMulticastGroup C# (CSharp) Метод

JoinMulticastGroup() публичный Метод

public JoinMulticastGroup ( [ host ) : void
host [
Результат void
		public extern void JoinMulticastGroup([In] HostName host);
		[Overload("GetOutputStreamAsync")]

Usage Example

Пример #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