private void send(String msg) throws RemotingException { DatagramPacket hi = new DatagramPacket(msg.getBytes(), msg.length(), mutilcastAddress, mutilcastSocket.getLocalPort()); try { mutilcastSocket.send(hi); } catch (IOException e) { throw new IllegalStateException(e.getMessage(), e); } }
private void send(String msg) throws RemotingException { DatagramPacket hi = new DatagramPacket(msg.getBytes(), msg.length(), mutilcastAddress, mutilcastSocket.getLocalPort()); try { mutilcastSocket.send(hi); } catch (IOException e) { throw new IllegalStateException(e.getMessage(), e); } }
private void send(String msg) throws RemotingException { DatagramPacket hi = new DatagramPacket(msg.getBytes(), msg.length(), mutilcastAddress, mutilcastSocket.getLocalPort()); try { mutilcastSocket.send(hi); } catch (IOException e) { throw new IllegalStateException(e.getMessage(), e); } }
private void send(String msg) throws RemotingException { DatagramPacket hi = new DatagramPacket(msg.getBytes(), msg.length(), mutilcastAddress, mutilcastSocket.getLocalPort()); try { mutilcastSocket.send(hi); } catch (IOException e) { throw new IllegalStateException(e.getMessage(), e); } }
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 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(); }
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 IpAddress createLocalAddress() { if(sock == null || sock.isClosed()) return null; if(external_addr != null) { if(external_port > 0) return new IpAddress(external_addr, external_port); return new IpAddress(external_addr, sock.getLocalPort()); } return new IpAddress(sock.getLocalAddress(), sock.getLocalPort()); }
System.out.println("Socket=" + sock.getLocalAddress() + ':' + sock.getLocalPort() + ", bind interface=" + sock.getInterface());
sock=sockets[i]; if(sock == null) continue; System.out.println("Socket #" + (i + 1) + '=' + sock.getLocalAddress() + ':' + sock.getLocalPort() + ", ttl=" + sock.getTimeToLive() + ", bind interface=" + sock.getInterface());
/** * * @return the source port for multicast packet * @since 1.8 */ public int getLocalPort(){ return ssdpMultiSock.getLocalPort(); }
logger.debug("Listening for acks on port: " + socket.getLocalPort());
/** * * @return the source port for multicast packet * @since 1.8 */ public int getLocalPort(){ return ssdpMultiSock.getLocalPort(); }
return; final int testPort = socket.getLocalPort(); final String multicastAddress = this.multicastRule.getGroup(); final String payload = "foo";
return; final int testPort = socket.getLocalPort(); final AtomicInteger ackPort = new AtomicInteger();
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()); }
protected IpAddress createLocalAddress() { if(sock == null || sock.isClosed()) return null; if(external_addr != null) { if(external_port > 0) return new IpAddress(external_addr, external_port); return new IpAddress(external_addr, sock.getLocalPort()); } return new IpAddress(sock.getLocalAddress(), sock.getLocalPort()); }
protected IpAddress createLocalAddress() { if(sock == null || sock.isClosed()) return null; if(external_addr != null) { if(external_port > 0) return new IpAddress(external_addr, external_port); return new IpAddress(external_addr, sock.getLocalPort()); } return new IpAddress(sock.getLocalAddress(), sock.getLocalPort()); }