---
title: CloseConnection
description: "关闭通信连接，销毁通信资源。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2300/armnative/kunpengcpsvideo_17_0025.html
sourcePath: /source/zh/kunpengboostkithistory/2300/armnative/kunpengcpsvideo_17_0025.html
indexId: e6ea66afbd8cc78a5c66455bc8570c1e398b9faa50781c7c8364a72949a7870c77
---
# CloseConnection

#### 函数功能

关闭通信连接，销毁通信资源。


#### 约束说明

该接口是视频流引擎要求二次开发者在通信模块实现的外部符号，视频流引擎会调用该接口关闭并销毁指定的通信连接。在通信连接中断后，SendFully和Recv调用应返回错误码。


#### 函数原型

int CloseConnection(int connection)


#### 参数说明

| 参数名称 | 输入/输出 | 参数类型 | 参数描述 |
| --- | --- | --- | --- |
| connection | 输入 | int | OnNewConnectionCallback返回的连接句柄。 |


#### 返回值说明

数据类型：int

取值如下：

- 0：表示成功。
- 非0：错误码。
