/** * @return the local address * @throws IOException */ public SocketAddress getLocalAddress() throws IOException { return this.channel.getLocalAddress(); }
@Override public SocketAddress getLocalAddress() throws IOException { return ac.getLocalAddress(); }
@Override public SocketAddress getLocalAddress() throws IOException { return ac.getLocalAddress(); }
public InetSocketAddress getLocalSocketAddress() throws IOException { return (InetSocketAddress) sock.getLocalAddress(); }
@Override public InetSocketAddress getLocalAddress() { if (localAddress != null) { return localAddress; } else { try { localAddress = (InetSocketAddress) socketChannel.getLocalAddress(); return localAddress; } catch (IOException e) { log.error("The session {} gets local address error", e, sessionId); return null; } } }
@Override public InetSocketAddress getLocalAddress() { if (localAddress != null) { return localAddress; } else { try { localAddress = (InetSocketAddress) socketChannel.getLocalAddress(); return localAddress; } catch (IOException e) { log.error("The session {} gets local address error", e, sessionId); return null; } } }
public Nio2Session(Nio2Service service, FactoryManager manager, IoHandler handler, AsynchronousSocketChannel socket) throws IOException { this.service = Objects.requireNonNull(service, "No service instance"); this.manager = Objects.requireNonNull(manager, "No factory manager"); this.ioHandler = Objects.requireNonNull(handler, "No IoHandler"); this.socketChannel = Objects.requireNonNull(socket, "No socket channel"); this.localAddress = socket.getLocalAddress(); this.remoteAddress = socket.getRemoteAddress(); if (log.isDebugEnabled()) { log.debug("Creating IoSession on {} from {}", localAddress, remoteAddress); } }
/** * @see AsynchronousSocketChannel#getLocalAddress() */ public final InetSocketAddress getLocalAddress() throws IOException { assertChannel(); return (InetSocketAddress) channel.getLocalAddress(); }
@Override public int getLocalPort() { try { return ((InetSocketAddress) socket.getLocalAddress()).getPort(); } catch (IOException e) { throw new SocketInfoException(e); } }
public Nio2Session(org.xbib.io.sshd.common.io.nio2.Nio2Service service, FactoryManager manager, IoHandler handler, AsynchronousSocketChannel socket) throws IOException { this.service = Objects.requireNonNull(service, "No service instance"); this.manager = Objects.requireNonNull(manager, "No factory manager"); this.ioHandler = Objects.requireNonNull(handler, "No IoHandler"); this.socketChannel = Objects.requireNonNull(socket, "No socket channel"); this.localAddress = socket.getLocalAddress(); this.remoteAddress = socket.getRemoteAddress(); }
@Override public InetAddress getLocalAddress() { try { return ((InetSocketAddress) socket.getLocalAddress()).getAddress(); } catch (IOException e) { throw new SocketInfoException(e); } }
@Override public InetSocketAddress getLocalAddress() { if (localAddress != null) { return localAddress; } else { try { localAddress = (InetSocketAddress) socketChannel.getLocalAddress(); return localAddress; } catch (IOException e) { log.error("the session {} gets local address error", e, sessionId); return null; } } }
public Nio2Session( Nio2Service service, FactoryManager manager, IoHandler handler, AsynchronousSocketChannel socket, SocketAddress acceptanceAddress) throws IOException { this.service = Objects.requireNonNull(service, "No service instance"); this.manager = Objects.requireNonNull(manager, "No factory manager"); this.ioHandler = Objects.requireNonNull(handler, "No IoHandler"); this.socketChannel = Objects.requireNonNull(socket, "No socket channel"); this.localAddress = socket.getLocalAddress(); this.remoteAddress = socket.getRemoteAddress(); this.acceptanceAddress = acceptanceAddress; if (log.isDebugEnabled()) { log.debug("Creating IoSession on {} from {} via {}", localAddress, remoteAddress, acceptanceAddress); } }
/** * @see org.tio.core.ChannelContext#createClientNode(java.nio.channels.AsynchronousSocketChannel) * * @param asynchronousSocketChannel * @return * @throws IOException * @author tanyaowu * 2016年12月6日 下午12:18:08 * */ @Override public Node createClientNode(AsynchronousSocketChannel asynchronousSocketChannel) throws IOException { InetSocketAddress inetSocketAddress = (InetSocketAddress) asynchronousSocketChannel.getLocalAddress(); Node clientNode = new Node(inetSocketAddress.getHostString(), inetSocketAddress.getPort()); return clientNode; }
public Writter(ByteBuffer data, A2 att, CompletionHandler<ByteBuffer, A2> callback) { this.data = data; this.att = att; this.callback = callback; }
@Override public void connect(HttpConnectRequest request) throws IOException { if (LOG.isLoggable(Level.INFO)) { LOG.log(Level.INFO, "Connected thread {0} to port {1} and host {2}:{3}", new Object[] { Thread.currentThread().getName(), channel.getLocalAddress().toString(), request.getHost(), request.getPort()}); } if (!authenticated) { authenticateOnConnect(request); } else { HttpUtils.sendHeader(request, channel); } }
@Override public void sendHeader(HttpRequest request) throws IOException { if (manipulator != null) { manipulator.manipulate(request); } if (LOG.isLoggable(Level.INFO)) { LOG.log(Level.INFO, "Connected thread {0} to port {1} and URL {2}", new Object[] { Thread.currentThread().getName(), channel.getLocalAddress().toString(), request.getResource() }); } if (!authenticated) { authenticate(request); } else { HttpUtils.sendHeader(request, channel); } }
@Override protected void populateLocalAddr() { SocketAddress socketAddress = null; try { socketAddress = getSocket().getIOChannel().getLocalAddress(); } catch (IOException e) { log.warn(sm.getString("endpoint.warn.noLocalAddr", getSocket()), e); } if (socketAddress instanceof InetSocketAddress) { localAddr = ((InetSocketAddress) socketAddress).getAddress().getHostAddress(); } }
@Override protected void populateLocalName() { SocketAddress socketAddress = null; try { socketAddress = getSocket().getIOChannel().getLocalAddress(); } catch (IOException e) { log.warn(sm.getString("endpoint.warn.noLocalName", getSocket()), e); } if (socketAddress instanceof InetSocketAddress) { localName = ((InetSocketAddress) socketAddress).getHostName(); } }
@Override protected void populateLocalPort() { SocketAddress socketAddress = null; try { socketAddress = getSocket().getIOChannel().getLocalAddress(); } catch (IOException e) { log.warn(sm.getString("endpoint.warn.noLocalPort", getSocket()), e); } if (socketAddress instanceof InetSocketAddress) { localPort = ((InetSocketAddress) socketAddress).getPort(); } }