---
title: 断链
description: "调用Disconnect接口断开并清理通信链路。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/hixlug/llmcdv2_42_28.html
sourcePath: /source/zh/canncommercial/900/API/hixlug/llmcdv2_42_28.html
indexId: 0aa197ee238ce2f2e0e73d6d833dff993eda780b25c896bd658566de5741b90e59
---
# 断链

#### 功能介绍

调用Disconnect接口断开并清理通信链路。


#### 使用场景

当P或者D集群节点出现异常时，通过断链清理异常链路，或者需要调整集群PD节点配比时，通过断链关闭已建立的链路。


#### 功能示例

通过在Client侧发起断链。

```
AscendString remote_engine = "ip:port"; // 替换成需要与之断链的Server的local engine
auto ret = engine.Disconnect(remote_engine);
if (ret != SUCCESS) {
    printf("[ERROR] Disconnect failed, ret = %u\n", ret);
    return -1;
}
```


#### 异常处理

更多异常处理请参考HIXL错误码。
