void connected(TcpSocket fan) throws IOException { InetSocketAddress sockAddr = (InetSocketAddress) socket.getRemoteSocketAddress(); this.remoteAddr = IpAddrPeer.make(sockAddr.getAddress()); this.remotePort = sockAddr.getPort(); this.in = SysInStream.make(socket.getInputStream(), getInBufferSize(fan)); this.out = SysOutStream.make(socket.getOutputStream(), getOutBufferSize(fan)); }
public IpAddr localAddr(TcpSocket fan) { if (!socket.isBound()) return null; InetAddress addr = socket.getLocalAddress(); if (addr == null) return null; return IpAddrPeer.make(addr); }