Package java.net

Examples of java.net.MulticastSocket.bind()


            if (join.getMulticastConfig().isEnabled()) {
                MulticastConfig multicastConfig = join.getMulticastConfig();
                MulticastSocket multicastSocket = new MulticastSocket(null);
                multicastSocket.setReuseAddress(true);
                // bind to receive interface
                multicastSocket.bind(new InetSocketAddress(multicastConfig.getMulticastPort()));
                multicastSocket.setTimeToLive(multicastConfig.getMulticastTimeToLive());
                try {
                    // set the send interface
                    final Address bindAddress = addressPicker.getBindAddress();
                    // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4417033
View Full Code Here


   */
  public void test_ConstructorLjava_net_SocketAddress() throws Exception
    MulticastSocket ms = new MulticastSocket((SocketAddress) null);
        assertTrue("should not be bound", !ms.isBound() && !ms.isClosed()
                && !ms.isConnected());
        ms.bind(new InetSocketAddress(InetAddress.getLocalHost(),
                Support_PortManager.getNextPortForUDP()));
        assertTrue("should be bound", ms.isBound() && !ms.isClosed()
                && !ms.isConnected());
        ms.close();
        assertTrue("should be closed", ms.isClosed());
View Full Code Here

        theSocket1 = new MulticastSocket(null);
        theSocket2 = new MulticastSocket(null);
        theSocket1.setReuseAddress(false);
        theSocket2.setReuseAddress(false);
        theSocket1.bind(theAddress);
        theSocket2.bind(theAddress);
        fail(
            "No exception when trying to connect to do duplicate socket bind with re-useaddr set to false");
      } catch (BindException e) {

      }
View Full Code Here

                        theSocket1 = new MulticastSocket(null);
                        theSocket2 = new MulticastSocket(null);
                        theSocket1.setReuseAddress(true);
                        theSocket2.setReuseAddress(true);
                        theSocket1.bind(theAddress);
                        theSocket2.bind(theAddress);

                        if (theSocket1 != null)
        theSocket1.close();
      if (theSocket2 != null)
        theSocket2.close();
View Full Code Here

                                    InetAddress.getLocalHost(),
                                    Support_PortManager.getNextPortForUDP());
                        theSocket1 = new MulticastSocket(null);
                        theSocket2 = new MulticastSocket(null);
                        theSocket1.bind(theAddress);
                        theSocket2.bind(theAddress);
      if (theSocket1 != null)
        theSocket1.close();
      if (theSocket2 != null)
        theSocket2.close();
      ensureExceptionThrownIfOptionIsUnsupportedOnOS(SO_REUSEADDR);
View Full Code Here

        theSocket1 = new MulticastSocket(null);
        theSocket2 = new MulticastSocket(null);
        theSocket1.setReuseAddress(false);
        theSocket2.setReuseAddress(false);
        theSocket1.bind(theAddress);
        theSocket2.bind(theAddress);
        fail(
            "No exception when trying to connect to do duplicate socket bind with re-useaddr set to false");
      } catch (BindException e) {

      }
View Full Code Here

                        theSocket1 = new MulticastSocket(null);
                        theSocket2 = new MulticastSocket(null);
                        theSocket1.setReuseAddress(true);
                        theSocket2.setReuseAddress(true);
                        theSocket1.bind(theAddress);
                        theSocket2.bind(theAddress);

                        if (theSocket1 != null)
        theSocket1.close();
      if (theSocket2 != null)
        theSocket2.close();
View Full Code Here

                                    InetAddress.getLocalHost(),
                                    Support_PortManager.getNextPortForUDP());
                        theSocket1 = new MulticastSocket(null);
                        theSocket2 = new MulticastSocket(null);
                        theSocket1.bind(theAddress);
                        theSocket2.bind(theAddress);
      if (theSocket1 != null)
        theSocket1.close();
      if (theSocket2 != null)
        theSocket2.close();
      ensureExceptionThrownIfOptionIsUnsupportedOnOS(SO_REUSEADDR);
View Full Code Here

   */
  public void test_ConstructorLjava_net_SocketAddress() throws Exception
    MulticastSocket ms = new MulticastSocket((SocketAddress) null);
        assertTrue("should not be bound", !ms.isBound() && !ms.isClosed()
                && !ms.isConnected());
        ms.bind(new InetSocketAddress(InetAddress.getLocalHost(),
                Support_PortManager.getNextPortForUDP()));
        assertTrue("should be bound", ms.isBound() && !ms.isClosed()
                && !ms.isConnected());
        ms.close();
        assertTrue("should be closed", ms.isClosed());
View Full Code Here

            if (join.getMulticastConfig().isEnabled()) {
                MulticastConfig multicastConfig = join.getMulticastConfig();
                MulticastSocket multicastSocket = new MulticastSocket(null);
                multicastSocket.setReuseAddress(true);
                // bind to receive interface
                multicastSocket.bind(new InetSocketAddress(multicastConfig.getMulticastPort()));
                multicastSocket.setTimeToLive(multicastConfig.getMulticastTimeToLive());
                try {
                    // set the send interface
                    final Address bindAddress = addressPicker.getBindAddress();
                    // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4417033
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.