> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Engine オブジェクトの SetLicensingConnectionRecoveryCallback メソッド

> ABBYY FineReader Engine API の Engine オブジェクトにある SetLicensingConnectionRecoveryCallback メソッド。ライセンス サーバー接続の切断に対処するための、ユーザー実装の ILicensingConnectionRecoveryCallback インターフェイスを設定します（Linux と Windows のみ）。

<Note>
  このメソッドは、Linux 版および Windows 版の FRE で実装されています。
</Note>

このメソッドは、接続の切断の管理に使用するユーザー実装のインターフェイスを設定します。

ライセンス サーバーへの接続が切断された場合は、次の方法で対処できます。

1. [ILicensingConnectionRecoveryCallback](/ja/fine-reader/engine/api-reference/license-related-objects/ilicensingconnectionrecoverycallback) インターフェイスを実装します。このインターフェイスの [OnDisconnect](/ja/fine-reader/engine/api-reference/license-related-objects/ilicensingconnectionrecoverycallback/ondisconnect-method) メソッドの実装で、接続の切断の発生後に実行する処理を指定します。たとえば、ネットワーク接続の再確立を複数回試み、成功した場合は [Engine](/ja/fine-reader/engine/api-reference/engine-object-iengine-interface) オブジェクトの [RestartLicensing](/ja/fine-reader/engine/api-reference/engine-object-iengine-interface/supplementary-methods/restartlicensing-method) メソッドを呼び出して、ライセンス機能を再開できます。
2. 実装したインターフェイスを接続の切断の処理に使用するよう指定するには、このインターフェイスへの参照を入力パラメーターとして指定して SetLicensingConnectionRecoveryCallback メソッドを呼び出します。
3. FineReader Engine の使用中に、何らかの理由でライセンス サーバーへの接続が切断されることがあります。機能ライセンスを必要とするメソッド (たとえば、各種処理メソッド) を呼び出そうとすると、OnDisconnect メソッドが呼び出されます。
4. OnDisconnect メソッドは、指定した処理を実行します。接続が正常に再確立され、処理を継続できる場合、このメソッドの戻り値は TRUE である必要があります。
5. 成功した場合、プログラムの動作は継続されます。

<div id="syntax">
  ## 構文
</div>

<div id="c">
  ### C++
</div>

```cpp theme={null}
HRESULT SetLicensingConnectionRecoveryCallback( ILicensingConnectionRecoveryCallback* Callback );
```

### C\#

```csharp theme={null}
void SetLicensingConnectionRecoveryCallback( ILicensingConnectionRecoveryCallback Callback );
```

<div id="visual-basic-net">
  ### Visual Basic .NET
</div>

```vb theme={null}
Sub SetLicensingConnectionRecoveryCallback(Callback As ILicensingConnectionRecoveryCallback)
```

<div id="parameters">
  ## パラメーター
</div>

Callback

\[in] このパラメーターは、ユーザー実装のインターフェイス [ILicensingConnectionRecoveryCallback](/ja/fine-reader/engine/api-reference/license-related-objects/ilicensingconnectionrecoverycallback) を参照します。

<div id="return-values">
  ## 戻り値
</div>

このメソッド固有の戻り値はありません。返されるのは、[ABBYY FineReader Engine 関数の標準戻り値](/ja/fine-reader/engine/api-reference/return-codes)です。

<div id="remarks">
  ## 備考
</div>

Linux では、Engine オブジェクトがプロセス外サーバーとして読み込まれている場合、このメソッドは動作しません。

<div id="see-also">
  ## 関連項目
</div>

[Engine](/ja/fine-reader/engine/api-reference/engine-object-iengine-interface)
