public int getRemotePort() { try { return ((InetSocketAddress) this.channel.getRemoteAddress()).getPort(); } catch (IOException e) { return 0; } }
public int getRemotePort() { if(this.dataChannel != null && this.dataChannel.isConnected()) { try { return ((InetSocketAddress) this.dataChannel.getRemoteAddress()).getPort(); } catch (IOException e) { logger.error("Could not lookup the remote peer port", e); } } return 0; }
public String getRemoteHost() { if(this.dataChannel != null && this.dataChannel.isConnected()) { try { return ((InetSocketAddress) this.dataChannel.getRemoteAddress()).getHostString(); } catch (IOException e) { logger.error("Could not lookup the remote peer address", e); } } return ""; }
public int getRemotePort() { if(this.dataChannel != null && this.dataChannel.isConnected()) { try { return ((InetSocketAddress) this.dataChannel.getRemoteAddress()).getPort(); } catch (IOException e) { logger.error("Could not lookup the remote peer port", e); } } return 0; }
public String getRemoteHost() { if(this.dataChannel != null && this.dataChannel.isConnected()) { try { return ((InetSocketAddress) this.dataChannel.getRemoteAddress()).getHostString(); } catch (IOException e) { logger.error("Could not lookup the remote peer address", e); } } return ""; }
public int getRemotePort() { if(this.dataChannel != null && this.dataChannel.isConnected()) { try { return ((InetSocketAddress) this.dataChannel.getRemoteAddress()).getPort(); } catch (IOException e) { logger.error("Could not lookup the remote peer port", e); } } return 0; }
public int getRemotePort() { if(this.dataChannel != null && this.dataChannel.isConnected()) { try { return ((InetSocketAddress) this.dataChannel.getRemoteAddress()).getPort(); } catch (IOException e) { logger.error("Could not lookup the remote peer port", e); } } return 0; }
public String getRemoteHost() { if(this.dataChannel != null && this.dataChannel.isConnected()) { try { return ((InetSocketAddress) this.dataChannel.getRemoteAddress()).getHostString(); } catch (IOException e) { logger.error("Could not lookup the remote peer address", e); } } return ""; }
@Override public void send() throws IOException { byte[] data = this.pendingData.poll(); if (data != null) { ByteBuffer buffer = ByteBuffer.wrap(data); this.dataChannel.send(buffer, this.dataChannel.getRemoteAddress()); // Keep sending queued data, recursive style send(); } }
@Override public void send(byte[] data) throws IOException { if (isConnected()) { this.dataChannel.send(ByteBuffer.wrap(data), this.dataChannel.getRemoteAddress()); } else { throw new IOException("Channel is not connected"); } }
@Override public void send() throws IOException { byte[] data = this.pendingData.poll(); if (data != null) { ByteBuffer buffer = ByteBuffer.wrap(data); this.dataChannel.send(buffer, this.dataChannel.getRemoteAddress()); // Keep sending queued data, recursive style send(); } }
@Override public void send(byte[] data) throws IOException { if (isConnected()) { this.dataChannel.send(ByteBuffer.wrap(data), this.dataChannel.getRemoteAddress()); } else { throw new IOException("Channel is not connected"); } }
@Override public void send(byte[] data) throws IOException { if (isConnected()) { this.dataChannel.send(ByteBuffer.wrap(data), this.dataChannel.getRemoteAddress()); } else { throw new IOException("Channel is not connected"); } }
@Override public void send(byte[] data) throws IOException { if (isConnected()) { this.dataChannel.send(ByteBuffer.wrap(data), this.dataChannel.getRemoteAddress()); } else { throw new IOException("Channel is not connected"); } }
@Override public void send() throws IOException { byte[] data = this.pendingData.poll(); if (data != null) { ByteBuffer buffer = ByteBuffer.wrap(data); this.dataChannel.send(buffer, this.dataChannel.getRemoteAddress()); // Keep sending queued data, recursive style send(); } }
@Override public InetSocketAddress getRemoteAddress() { if (isConnected()) { try { final SocketAddress address = this.dataChannel.getRemoteAddress(); return address == null ? null : (InetSocketAddress) address; } catch (IOException e) { log().warn("Cannot retrieve remote address.", e); } } return null; }
@Override public InetSocketAddress getRemoteAddress() { if (isConnected()) { try { final SocketAddress address = this.dataChannel.getRemoteAddress(); return address == null ? null : (InetSocketAddress) address; } catch (IOException e) { log().warn("Cannot retrieve remote address.", e); } } return null; }
@Override public InetSocketAddress getRemoteAddress() { if (isConnected()) { try { final SocketAddress address = this.dataChannel.getRemoteAddress(); return address == null ? null : (InetSocketAddress) address; } catch (IOException e) { log().warn("Cannot retrieve remote address.", e); } } return null; }
@Override public InetSocketAddress getRemoteAddress() { if (isConnected()) { try { final SocketAddress address = this.dataChannel.getRemoteAddress(); return address == null ? null : (InetSocketAddress) address; } catch (IOException e) { log().warn("Cannot retrieve remote address.", e); } } return null; }
@Override public void send(byte[] buf, int off, int len) throws IOException { if (!hasTimeout()) { if (this.channel != null && this.channel.isOpen() && this.channel.isConnected()) { this.channel.send(ByteBuffer.wrap(buf, off, len), channel.getRemoteAddress()); } else { logger.warn("Handler skipped send operation because channel is not open or connected."); } } else { logger.warn("Handler has timed out so send operation will be skipped."); } }