Package java.net

Examples of java.net.MulticastSocket.bind()


        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);
      } catch (BindException e) {
        fail(
            "unexpected exception when trying to connect to do duplicate socket bind with re-useaddr left as default");
      }
      if (theSocket1 != null)
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

   */
  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);
      } catch (BindException e) {
        fail(
            "unexpected exception when trying to connect to do duplicate socket bind with re-useaddr left as default");
      }
      if (theSocket1 != null)
View Full Code Here

                MulticastSocket socket = new MulticastSocket(null);
                socket.setReuseAddress(true);
                socket.setReceiveBufferSize(64 * 1024);
                socket.setSendBufferSize(64 * 1024);
                socket.setTimeToLive(1);
                socket.bind(new InetSocketAddress(isa.getPort()));
                socket.joinGroup(isa.getAddress());
                mcast = socket;
                queue.execute(new MCastListener());
            } else {
               
View Full Code Here

  {
    try {
      MulticastSocket msock;
      if ((bindAddr) != null && (0 < bindPort)) {
        msock = new MulticastSocket(null);
        msock.bind(new InetSocketAddress(bindAddr, bindPort));
      }else{
        msock = new MulticastSocket();
      }
      DatagramPacket dgmPacket = new DatagramPacket(msg.getBytes(), msg.length(), ssdpMultiGroup);
      // Thnaks for Theo Beisch (11/09/04)
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.