---
title: 指令流引擎事件通知
description: "接收指令流引擎上报的事件并处理。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengcps/boostcph/instrucstreamengine/kunpengcpsinstruction_16_0024.html
sourcePath: /source/zh/kunpengcps/boostcph/instrucstreamengine/kunpengcpsinstruction_16_0024.html
indexId: a3e0cd1d104017af87942eadb745917bbc543c7e5dd1d001e4298de0648ada5b85
---
# 指令流引擎事件通知

#### 场景介绍

接收指令流引擎上报的事件并处理。


#### 前提条件

指令流引擎启动成功。


#### 开发流程

在onVmiEngineEvent回调函数，处理不同错误码。


#### 编码实例

```
public void onVmiEngineEvent (int event, int reserved0, int reserved1, int reserved2, int reserved3, String additionInfo) {
    if (event == InstructionEngine.VMI_ENGINE_EVENT_SOCK_DISCONN) {
        // 网络断开
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                // 停止逻辑线程
                stopMonitorBlocked();
                if (upstreamReceiveDispatcher != null) {
                    upstreamReceiveDispatcher.stopBlocked();
                    upstreamReceiveDispatcher = null;
                }
                
                // 执行指令流重连流程的开发章节的重连流程
                // 或者退出云手机
            }
        });
    }
}
```
