예제 #1
0
 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));
 }
예제 #2
0
 public IpAddr localAddr(TcpSocket fan) {
   if (!socket.isBound()) return null;
   InetAddress addr = socket.getLocalAddress();
   if (addr == null) return null;
   return IpAddrPeer.make(addr);
 }