@Override public InetAddress getInterface() { if (javaSocket instanceof MulticastSocket) { try { return ((MulticastSocket) javaSocket).getInterface(); } catch (SocketException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
@Override public InetAddress getInterface() { if (javaSocket instanceof MulticastSocket) { try { return ((MulticastSocket) javaSocket).getInterface(); } catch (SocketException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
@Override public InetAddress getInterface() { if (javaSocket instanceof MulticastSocket) { try { return ((MulticastSocket) javaSocket).getInterface(); } catch (SocketException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
public InetAddress getInterface() { if (socket instanceof MulticastSocket) { try { return ((MulticastSocket) socket).getInterface(); } catch (SocketException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
Receiver(InetAddress mcast_addr, InetAddress bind_interface, int port) throws Exception { sock=new MulticastSocket(port); if(bind_interface != null) sock.setInterface(bind_interface); sock.joinGroup(mcast_addr); System.out.println("Socket=" + sock.getLocalAddress() + ':' + sock.getLocalPort() + ", bind interface=" + sock.getInterface()); }
protected Receiver() throws Exception { InetSocketAddress saddr=new InetSocketAddress(mcast_addr, mcast_port); if(can_bind_to_mcast_addr) mcast_sock=new MulticastSocket(saddr); else mcast_sock=new MulticastSocket(mcast_port); if(bind_addr != null) bindToInterfaces(Arrays.asList(NetworkInterface.getByInetAddress(bind_addr)), mcast_sock); else { List<NetworkInterface> intf_list=Util.getAllAvailableInterfaces(); System.out.println("Joining " + saddr + " on interfaces: " + intf_list); bindToInterfaces(intf_list, mcast_sock); } System.out.println("Socket=" + mcast_sock.getLocalAddress() + ':' + mcast_sock.getLocalPort() + ", bind interface=" + mcast_sock.getInterface()); }
protected String dumpSocketInfo() throws Exception { StringBuilder sb=new StringBuilder(128); Formatter formatter=new Formatter(sb); formatter.format("mcast_addr=%s, bind_addr=%s, ttl=%d", mcast_addr, bind_addr, ip_ttl); if(sock != null) formatter.format("\nsock: bound to %s:%d, receive buffer size=%d, send buffer size=%d", sock.getLocalAddress().getHostAddress(), sock.getLocalPort(), sock.getReceiveBufferSize(), sock.getSendBufferSize()); if(mcast_sock != null) formatter.format("\nmcast_sock: bound to %s:%d, send buffer size=%d, receive buffer size=%d", mcast_sock.getInterface().getHostAddress(), mcast_sock.getLocalPort(), mcast_sock.getSendBufferSize(), mcast_sock.getReceiveBufferSize()); return sb.toString(); }
sock.getInterface());
if(sock == null) continue; System.out.println("Socket #" + (i + 1) + '=' + sock.getLocalAddress() + ':' + sock.getLocalPort() + ", ttl=" + sock.getTimeToLive() + ", bind interface=" + sock.getInterface());
@Override protected void convertAndSend(Message<?> message) throws Exception { super.convertAndSend(message); if (logger.isDebugEnabled()) { logger.debug("Sent packet to " + this.multicastSocket.getInterface()); } }
@Override public InetAddress getInterface() { if (javaSocket instanceof MulticastSocket) { try { return ((MulticastSocket) javaSocket).getInterface(); } catch (SocketException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
@Override public InetAddress getInterface() { if (javaSocket instanceof MulticastSocket) { try { return ((MulticastSocket) javaSocket).getInterface(); } catch (SocketException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
public InetAddress getInterface() { if (socket instanceof MulticastSocket) { try { return ((MulticastSocket) socket).getInterface(); } catch (SocketException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
@Override public InetAddress getInterface() { if (javaSocket instanceof MulticastSocket) { try { return ((MulticastSocket) javaSocket).getInterface(); } catch (SocketException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
@Override public InetAddress getInterface() { if (javaSocket instanceof MulticastSocket) { try { return ((MulticastSocket) javaSocket).getInterface(); } catch (SocketException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
public InetAddress getInterface() { if (socket instanceof MulticastSocket) { try { return ((MulticastSocket) socket).getInterface(); } catch (SocketException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
Receiver(InetAddress mcast_addr, InetAddress bind_interface, int port) throws Exception { sock=new MulticastSocket(port); if(bind_interface != null) sock.setInterface(bind_interface); sock.joinGroup(mcast_addr); System.out.println("Socket=" + sock.getLocalAddress() + ':' + sock.getLocalPort() + ", bind interface=" + sock.getInterface()); }
Receiver(InetAddress mcast_addr, InetAddress bind_interface, int port) throws Exception { sock=new MulticastSocket(port); if(bind_interface != null) sock.setInterface(bind_interface); sock.joinGroup(mcast_addr); System.out.println("Socket=" + sock.getLocalAddress() + ':' + sock.getLocalPort() + ", bind interface=" + sock.getInterface()); }
Receiver(InetAddress mcast_addr, InetAddress bind_interface, int port) throws Exception { sock=new MulticastSocket(port); if(bind_interface != null) sock.setInterface(bind_interface); sock.joinGroup(mcast_addr); System.out.println("Socket=" + sock.getLocalAddress() + ':' + sock.getLocalPort() + ", bind interface=" + sock.getInterface()); }
Receiver(InetAddress mcast_addr, InetAddress bind_interface, int port) throws Exception { sock=new MulticastSocket(port); if(bind_interface != null) sock.setInterface(bind_interface); sock.joinGroup(mcast_addr); System.out.println("Socket=" + sock.getLocalAddress() + ':' + sock.getLocalPort() + ", bind interface=" + sock.getInterface()); }