Package java.net

Examples of java.net.MulticastSocket.bind()


                if (broadcast != null) socket.setBroadcast(broadcast.booleanValue());
                if (receiveBufferSize != null) socket.setReceiveBufferSize(receiveBufferSize.intValue());
                if (sendBufferSize != null) socket.setSendBufferSize(sendBufferSize.intValue());
                if (reuseAddress != null) socket.setReuseAddress(reuseAddress.booleanValue());
                if (trafficClass != null) socket.setTrafficClass(trafficClass.intValue());
                socket.bind(address);
                //noinspection unchecked
                final IoHandler<? super UdpChannel> handler = handlerFactory.createHandler();
                final BioMulticastChannelImpl channel = new BioMulticastChannelImpl(socket.getSendBufferSize(), socket.getReceiveBufferSize(), executor, handler, socket, globalBytesRead, globalBytesWritten, globalMessagesRead, globalMessagesWritten);
                final FutureUdpChannel futureUdpChannel = new FutureUdpChannel(channel, new Closeable() {
                    public void close() throws IOException {
View Full Code Here


      // Send multi-cast packet
      MulticastSocket multicast = null;
      try {
        multicast = new MulticastSocket(null);
        multicast.bind(srcAddress);
        logger.debug("Source-Address = '{}'", srcAddress);
        multicast.setTimeToLive(4);
        logger.debug("Send multicast request.");
        multicast.send(discoveryPacket);
      } finally {
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.