public SocketAddress getLocalAddress() throws IOException { return delegate.getLocalAddress(); } public boolean equals(Object obj) { return delegate.equals(obj); }
@Override public SocketAddress getLocalAddress() throws IOException { return channel.getLocalAddress(); }
@Override public SocketAddress getLocalAddress() throws IOException { return channel.getLocalAddress(); }
public int getLocalPort() { try { return ((InetSocketAddress) this.channel.getLocalAddress()).getPort(); } catch (IOException e) { return 0; } }
public int getLocalPort() { try { return ((InetSocketAddress) this.channel.getLocalAddress()).getPort(); } catch (IOException e) { return 0; } }
public String getLocalAddress() { try { return ((InetSocketAddress) this.channel.getLocalAddress()).getHostName(); } catch (IOException e) { return ""; } }
public String getLocalAddress() { try { return ((InetSocketAddress) this.channel.getLocalAddress()).getHostName(); } catch (IOException e) { return ""; } }
@Override public SocketAddress getLocalAddress() { if(isOpen()) { try { return this.dataChannel.getLocalAddress(); } catch (IOException e) { logger.error("Could not get local addres of the data channel: "+ e.getMessage()); } } return null; }
@Override public SocketAddress getLocalAddress() { if(isOpen()) { try { return this.dataChannel.getLocalAddress(); } catch (IOException e) { logger.error("Could not get local addres of the data channel: "+ e.getMessage()); } } return null; }
@Override public String getLocalHost() { if(this.dataChannel != null && this.dataChannel.isOpen()) { try { return ((InetSocketAddress) this.dataChannel.getLocalAddress()).getHostString(); } catch (IOException e) { logger.error("Could not lookup the local channel address: "+ e.getMessage(), e); } } return ""; }
@Override public SocketAddress getLocalAddress() { if(isOpen()) { try { return this.dataChannel.getLocalAddress(); } catch (IOException e) { logger.error("Could not get local addres of the data channel: "+ e.getMessage()); } } return null; }
@Override public String getLocalHost() { if(this.dataChannel != null && this.dataChannel.isOpen()) { try { return ((InetSocketAddress) this.dataChannel.getLocalAddress()).getHostString(); } catch (IOException e) { logger.error("Could not lookup the local channel address: "+ e.getMessage(), e); } } return ""; }
@Override public SocketAddress getLocalAddress() { if(isOpen()) { try { return this.dataChannel.getLocalAddress(); } catch (IOException e) { logger.error("Could not get local addres of the data channel: "+ e.getMessage()); } } return null; }
@Override public String getLocalHost() { if(this.dataChannel != null && this.dataChannel.isOpen()) { try { return ((InetSocketAddress) this.dataChannel.getLocalAddress()).getHostString(); } catch (IOException e) { logger.error("Could not lookup the local channel address: "+ e.getMessage(), e); } } return ""; }
@Override public String getLocalHost() { if(this.dataChannel != null && this.dataChannel.isOpen()) { try { return ((InetSocketAddress) this.dataChannel.getLocalAddress()).getHostString(); } catch (IOException e) { logger.error("Could not lookup the local channel address: "+ e.getMessage(), e); } } return ""; }
@Override public InetSocketAddress getLocalAddress() { if (isOpen()) { try { final SocketAddress address = this.dataChannel.getLocalAddress(); return address == null ? null : (InetSocketAddress) address; } catch (IOException e) { log().warn("Cannot retrieve local address.", e); } } return null; }
@Override public InetSocketAddress getLocalAddress() { if (isOpen()) { try { final SocketAddress address = this.dataChannel.getLocalAddress(); return address == null ? null : (InetSocketAddress) address; } catch (IOException e) { log().warn("Cannot retrieve local address.", e); } } return null; }
@Override public InetSocketAddress getLocalAddress() { if (isOpen()) { try { final SocketAddress address = this.dataChannel.getLocalAddress(); return address == null ? null : (InetSocketAddress) address; } catch (IOException e) { log().warn("Cannot retrieve local address.", e); } } return null; }
@Override public InetSocketAddress getLocalAddress() { if (isOpen()) { try { final SocketAddress address = this.dataChannel.getLocalAddress(); return address == null ? null : (InetSocketAddress) address; } catch (IOException e) { log().warn("Cannot retrieve local address.", e); } } return null; }
public UtpMultiplexer(TorrentClient client, UtpPeerConnectionAcceptor connectionAcceptor, PacketReader packetReader, int port) throws IOException { this.connectionAcceptor = connectionAcceptor; this.packetReader = packetReader; connectionAcceptorRunnable = new LoopingRunnable(connectionAcceptor); connectionAcceptorThread = new Thread(connectionAcceptorRunnable, "uTP Connection Acceptor"); channel = DatagramChannel.open(); channel.setOption(StandardSocketOptions.SO_REUSEADDR, true); channel.bind(new InetSocketAddress(port)); channel.configureBlocking(false); socketRegistry = new UtpSocketRegistry(channel); connectionAcceptorThread.start(); LOGGER.trace("Configured to listen on {}", channel.getLocalAddress()); poller = client.getExecutorService().scheduleWithFixedDelay(this::pollPackets, 50, 10, TimeUnit.MILLISECONDS); }