public Duration getReceiveTimeout(TcpSocket fan) { try { int timeout = socket.getSoTimeout(); if (timeout <= 0) return null; return Duration.makeMillis(timeout); } catch (IOException e) { throw IOErr.make(e); } }