Пример #1
0
        public Client(ClientForm clientForm)
        {
            this.clientForm  = clientForm;
            client           = new UdpClient();
            multicastAddress = IPAddress.Parse("239.0.0.222");
            ipEndPoint       = new IPEndPoint(IPAddress.Any, 2222);

            client.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
            client.ExclusiveAddressUse = false;
            client.Client.Bind(ipEndPoint);

            client.JoinMulticastGroup(multicastAddress);
        }
Пример #2
0
        public Client(ClientForm clientForm)
        {
            this.clientForm = clientForm;
            client = new UdpClient();
            multicastAddress = IPAddress.Parse("239.0.0.222");
            ipEndPoint = new IPEndPoint(IPAddress.Any, 2222);

            client.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
            client.ExclusiveAddressUse = false;
            client.Client.Bind(ipEndPoint);

            client.JoinMulticastGroup(multicastAddress);
        }