acquire() public method

public acquire ( ) : void
return void
        static ApplicationWebService()
        {
            // http://www.zzzxo.com/q/answers-android-device-not-receiving-multicast-package-13221736.html



            new Thread(
                delegate()
                {
                    // http://stackoverflow.com/questions/12610415/multicast-receiver-malfunction
                    // http://answers.unity3d.com/questions/250732/android-build-is-not-receiving-udp-broadcasts.html

                    // Acquire multicast lock
                    wifi = (WifiManager)ScriptCoreLib.Android.ThreadLocalContextReference.CurrentContext.getSystemService(Context.WIFI_SERVICE);
                    multicastLock = wifi.createMulticastLock("multicastLock");
                    //multicastLock.setReferenceCounted(true);
                    multicastLock.acquire();

                    System.Console.WriteLine("LANBroadcastListener ready...");
                    try
                    {
                        byte[] b = new byte[0x100];

                        // https://code.google.com/p/android/issues/detail?id=40003

                        MulticastSocket socket = new MulticastSocket(40404); // must bind receive side
                        socket.setBroadcast(true);
                        socket.setReuseAddress(true);
                        socket.setTimeToLive(30);
                        socket.setReceiveBufferSize(0x100);


                        socket.joinGroup(InetAddress.getByName("239.1.2.3"));
                        System.Console.WriteLine("LANBroadcastListener joinGroup...");
                        while (true)
                        {
                            DatagramPacket dgram = new DatagramPacket((sbyte[])(object)b, b.Length);
                            socket.receive(dgram); // blocks until a datagram is received

                            var bytes = new MemoryStream((byte[])(object)dgram.getData(), 0, dgram.getLength());


                            var listen = Encoding.UTF8.GetString(bytes.ToArray());

                            Console.WriteLine(new { listen });

                            var skip = false;

                            foreach (var item in data)
                            {
                                if (item == listen)
                                    skip = true;

                            }

                            if (!skip)
                                data.Add(listen);

                            //                            { listen = http://www.fun2code.de/articles/multicast_images_java/multicast_images_java.html }
                            //client error, { Message = , StackTrace = java.lang.RuntimeException
                            //       at ScriptCoreLibJava.BCLImplementation.System.Collections.Generic.__List_1.Contains(__List_1.java:102)
                            //       at ScriptCoreLib.Extensions.ListExtensions.AddDistinct(ListExtensions.java:17)

                            //System.Console.WriteLine("Received "
                            //    + listen
                            //    + " bytes from " + dgram.getAddress());
                            //dgram.setLength(b.Length); // must reset length field!s



                        }
                    }
                    catch (Exception ex)
                    {
                        System.Console.WriteLine("client error, " + new { ex.Message, ex.StackTrace });
                    }
                }
            )
            {

                Name = "client"
            }.Start();
        }
        protected override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);

            var sv = new ScrollView(this);
            var b2 = new Button(this);
            {
                var ll = new LinearLayout(this);
                //ll.setOrientation(LinearLayout.VERTICAL);
                sv.addView(ll);

                var b1 = new Button(this).AttachTo(ll);



                b1.WithText("LANBroadcastListener createMulticastLock");


                var c = 0;

                b1.AtClick(
                    v =>
                    {
                        //                 server error { Message = , StackTrace = android.os.NetworkOnMainThreadException
                        //at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
                        //at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:175)
                        //at libcore.io.IoBridge.sendto(IoBridge.java:473)
                        //at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:182)
                        //at java.net.DatagramSocket.send(DatagramSocket.java:284)

                        new Thread(
                            delegate()
                            {

                                try
                                {
                                    var socket = new DatagramSocket(); //construct a datagram socket and binds it to the available port and the localhos

                                    c++;

                                    var b = Encoding.UTF8.GetBytes(c + " hi from jvm!");    //creates a variable b of type byte
                                    var dgram = new DatagramPacket((sbyte[])(object)b, b.Length, InetAddress.getByName("239.1.2.3"), 40404);//sends the packet details, length of the packet,destination address and the port number as parameters to the DatagramPacket  
                                    //dgram.setData(b);
                                    //System.Console.WriteLine(
                                    //    "Sending " + b.Length + " bytes to " + dgram.getAddress() + ":" + dgram.getPort());//standard error output stream
                                    socket.send(dgram); //send the datagram packet from this port
                                }
                                catch (Exception ex)
                                {
                                    System.Console.WriteLine("server error " + new { ex.Message, ex.StackTrace });
                                }

                            }
                                )
                               {

                                   Name = "sender"
                               }.Start();
                    }
                );

                b2.setText("The other button!");
                ll.addView(b2);

                this.setContentView(sv);
            }


            // http://www.zzzxo.com/q/answers-android-device-not-receiving-multicast-package-13221736.html



            new Thread(
                delegate()
                {
                    // http://stackoverflow.com/questions/12610415/multicast-receiver-malfunction
                    // http://answers.unity3d.com/questions/250732/android-build-is-not-receiving-udp-broadcasts.html

                    // Acquire multicast lock
                    wifi = (WifiManager)getSystemService(Context.WIFI_SERVICE);
                    multicastLock = wifi.createMulticastLock("multicastLock");
                    //multicastLock.setReferenceCounted(true);
                    multicastLock.acquire();

                    System.Console.WriteLine("LANBroadcastListener ready...");
                    try
                    {
                        byte[] b = new byte[0x100];

                        // https://code.google.com/p/android/issues/detail?id=40003

                        var port = 40404;

                        MulticastSocket socket = new MulticastSocket(port); // must bind receive side
                        socket.setBroadcast(true);
                        socket.setReuseAddress(true);
                        socket.setTimeToLive(30);
                        socket.setReceiveBufferSize(0x100);
                        
                        // https://code.google.com/p/android/issues/detail?id=40003
                        // http://stackoverflow.com/questions/6550618/multicast-support-on-android-in-hotspot-tethering-mode
                        // http://www.massapi.com/class/java/net/InetSocketAddress.java.html
                        // http://www.javadocexamples.com/java/net/MulticastSocket/joinGroup(SocketAddress%20mcastaddr,NetworkInterface%20netIf).html
                        // http://grokbase.com/t/hadoop/common-issues/117jsjk8d7/jira-created-hadoop-7472-rpc-client-should-deal-with-the-ip-address-changes

                        var group = InetAddress.getByName("239.1.2.3");
                        var groupSockAddr = new InetSocketAddress(group, port);

                        // what lan interfaces do we have?
                        socket.joinGroup(groupSockAddr,
                            NetworkInterface.getByName("wlan0")
                        );

                        System.Console.WriteLine("LANBroadcastListener joinGroup...");
                        while (true)
                        {
                            DatagramPacket dgram = new DatagramPacket((sbyte[])(object)b, b.Length);
                            socket.receive(dgram); // blocks until a datagram is received

                            var bytes = new MemoryStream((byte[])(object)dgram.getData(), 0, dgram.getLength());


                            var listen = Encoding.UTF8.GetString(bytes.ToArray());

                            System.Console.WriteLine("Received "
                                + dgram.getLength()
                                + " bytes from " + dgram.getAddress());
                            //dgram.setLength(b.Length); // must reset length field!s



                        }
                    }
                    catch
                    {
                        System.Console.WriteLine("client error");
                    }
                }
            )
            {

                Name = "client"
            }.Start();

        }
        public AndroidApplicationWebServiceMulticast()
        {
            AtData += AndroidApplicationWebServiceMulticast_AtData;

            new Thread(
                delegate()
                {
                    // http://stackoverflow.com/questions/12610415/multicast-receiver-malfunction
                    // http://answers.unity3d.com/questions/250732/android-build-is-not-receiving-udp-broadcasts.html

                    // Acquire multicast lock
                    wifi = (WifiManager)
                        ScriptCoreLib.Android.ThreadLocalContextReference.CurrentContext.getSystemService(Context.WIFI_SERVICE);
                    multicastLock = wifi.createMulticastLock("multicastLock");
                    //multicastLock.setReferenceCounted(true);
                    multicastLock.acquire();

                    System.Console.WriteLine("LANBroadcastListener ready...");
                    try
                    {
                        byte[] b = new byte[0x100];

                        // https://code.google.com/p/android/issues/detail?id=40003

                        MulticastSocket socket = new MulticastSocket(40404); // must bind receive side
                        socket.setBroadcast(true);
                        socket.setReuseAddress(true);
                        socket.setTimeToLive(30);
                        socket.setReceiveBufferSize(0x100);

                        socket.joinGroup(InetAddress.getByName("239.1.2.3"));
                        System.Console.WriteLine("LANBroadcastListener joinGroup...");
                        while (true)
                        {
                            DatagramPacket dgram = new DatagramPacket((sbyte[])(object)b, b.Length);
                            socket.receive(dgram); // blocks until a datagram is received

                            var bytes = new MemoryStream((byte[])(object)dgram.getData(), 0, dgram.getLength());


                            var listen = Encoding.UTF8.GetString(bytes.ToArray());



                            //dgram.setLength(b.Length); // must reset length field!s

                            if (AtData != null)
                                AtData(listen);

                        }
                    }
                    catch
                    {
                        System.Console.WriteLine("client error");
                    }
                }
            )
            {

                Name = "client"
            }.Start();


        }
        static ApplicationWebService()
        {
#if Android
            Console.WriteLine("ApplicationWebService cctor");

            if (__AndroidMulticast.value == null)
            {



                // Acquire multicast lock
                wifi = (WifiManager)
                    ScriptCoreLib.Android.ThreadLocalContextReference.CurrentContext.getSystemService(Context.WIFI_SERVICE);
                multicastLock = wifi.createMulticastLock("multicastLock");

                // ?
                //multicastLock.setReferenceCounted(true);
                multicastLock.acquire();

                __AndroidMulticast.value = new __AndroidMulticast(
                    value =>
                    {
                        Console.WriteLine(
                            "ApplicationWebService cctor: " +

                            new { value }

                        );

                        #region NotifyService
                        try
                        {
                            var xml = XElement.Parse(value);
                            // ApplicationWebService cctor: { value = <string reason="shake" c="8" preview="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAUBklEQVR4nN2dz5Mkx1XHv+9lVlX/mJ0fuzuS1kZCksMmrPCBCAEHMBEcIYAjEQQHgiB84z/hxh3wCQIHdoAPcMIYcAAH47BDQsi2tLJWsqwf+2tmdrq7qrIyH4eszM6q6p6d6dmetf2itre6uioz65PffJn56sfQi/v72NQa5x4uFjNjNk5he1YodWMyyZW6ZDpqfzTa4DABHlXV3fm8tvaSJdiSWZGZMUSUa02XSGcTQJW1d2ez07qWS2R8BSbAommMtaMsY9qQ0sUAichxVd1fLBrnNsvv6s04tzBmpLVi3uDwix1TNs1RWYr8lEunb8a5j05PN6vUiwHKLu3znpaJyGb1ejFATJs25adtTKSvoInRptk8dVO8YeVeEBCwmat76rbxgEif/fOw3aqfzUa2sfBXHCaJDX+9/Nj0qdgTUFAPByWfqWVEEaoMVn5qTTP7E7yoJ9LooqEESi8l/zVXigMRv0WSPeWnEhYBWWhifR08jpeOB1BXNesUpIlUF4Qkn0io4QphDcuZbsm4xZOWpy1hPP01pHRMjh7HiEJCGZENCfc+4wp1t+BJw+qX6sx9CqV6u/kSdgq/pgFqdOmkjNKvMXUFZEQQQZfLkFFshr2VzUgNG/7ZjNKvhVJDv5nuKQmmHiPNYafewj4PkSGmEbOEeY2sXzBYoa64Vhb3okRWyrxnOTN36ykVeL9IXUatgjjsxH5dJG5MCfqVCbNdQ8edAxkGsM7JaOXncCU93Gc3ZlaDAqf7RHZuwEin6vB0WIQTOpFX3HNEVK9B47qYVvJKMT1WQT3xrmz+Q+/ZI1UQUfAJAghRWuzVjikw0mmbUgCJqMBFAbxKSlPmag2ddStD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Dx37F7yncYmZxju5DWZs51wbSm5pkPzeA4rtT/WxgM9/Rv3pz5a9L3TogIvKnxNR/wO88QUADNGkXduWvAt06oIzZa2f4qtD8HF22SOfyaX4Jd7aZbR1QPCUm2qCVNd2Q2NW/5nKbgBIP7W2DHrr3uvyfK0A2KChu0V0FLQY91NB+0p1nbOnazhm2xfz8e3nSXlkrheRPKHwg7m9tdZhQ8/fhR2uAN91yg2a++pc1bwvQcVkWQMb8YLG4MZnEO1d6u/1Q7A/PPcm/eg+NLQFyIsaYPzm4nhN99fioaho/FLqkBxlfefvClnyQiJB/66t/ojNsz5W6zEzq6h0QthRRZKJZ07xfVe9U1XtNsz8apbdgpU8snN8mWXatKH5OmhgAIroTbuKcGXMtbx893SuKQutZXS+axp7j7zho5pHW14qieEov+t4WIJP8SZujstzJ2xhYvD9IRGrnqqYxzjXhLiEAikgRKeZMqUIpHQbiT8u2AkgAm1xrt85FPx2NiAqlzqkLufJAYrRtDSvi+XjPuuj+BSnr3IX+apKxNt51fcW2FUCUBDcORqMb4/GiWV4RE5G78/mF/uhWxnxUlk+F0f8Du/6q+dpYHY8AAAAASUVORK5CYII=" n="com.abstractatech.gamification.gir">Visit me at 192.168.43.7:25814</string> }


                            Console.WriteLine(new { xml });

                            // I/System.Console( 7351): ApplicationWebService cctor: { value = <string c="1">Visit me at 192.168.43.252:25452</string> }
                            ApplicationWebServiceExtensions.History.Add(
                                xml
                            );


                            var uri = "http://visit.jsc-solutions.net";

                            if (xml.Value.StartsWith("Visit me at "))
                                uri = "http://" + xml.Value.Substring("Visit me at ".Length);



                            #region intent
                            var c = ScriptCoreLib.Android.ThreadLocalContextReference.CurrentContext;

                            var intent = new Intent(c, typeof(foo.NotifyService).ToClass());

                            intent.putExtra("data0", "Another application running");

                            intent.putExtra("data1", uri);

                            c.startService(intent);
                            #endregion

                        }
                        catch (Exception ex)
                        {
                            // client error
                            System.Console.WriteLine(
                                "ApplicationWebService cctor error " +
                                new { ex.Message, ex.StackTrace }
                            );
                        }
                        #endregion




                        // http://grepcode.com/file/repository.springsource.com/org.apache.xalan/com.springsource.org.apache.xml.serializer/2.7.1/org/apache/xml/serializer/ToStream.java#2099




                    }
                );
            }

#endif

        }